+1 vote
47 views
ago in Communication protocols by Joan Valls Pérez (13 points)
edited ago by Joan Valls Pérez

Hello,

I would like to control a "Battery ESS (Generic)" component using Modbus communications over Ethernet from a computer external to the HIL. An example model is already provided (Generic microgrid with multiprotocol gateway) but in this case the CAN protocol is used instead of Modbus.

Using this example as an initial base, I have modified the "Battery ESS (Generic) UI" component that handles CAN communications, deleting all CAN-related configuration and blocks, and adding a Modbus Device for which I create a config in the model initialization file. I intend to keep the same input and output variables that the CAN interface used, keeping the same variable tipes, which are all "uint" as far as I can see.

When I try to validate the model, a number of errors arise related to the "Battery ESS (Generic)"  component. Some of those are:

Error occurred in handler 'pre_compile' of component Battery ESS (Generic).Battery DC Link SP1.dynamiccs
  → General error
  → ERROR in 'pre_compile' handler registered on component 'dynamiccs': can't multiply sequence by non-int of type 'float'

Error occurred in handler 'pre_compile' of component Battery ESS (Generic).battery_converter_control.Voltage Droop control1.LPF_V
  → General error
  → ERROR in 'pre_compile' handler registered on component 'LPF_V': can't multiply sequence by non-int of type 'float'

Error occurred in handler 'pre_compile' of component Battery ESS (Generic).battery_converter_control.Frequency Droop control1.LPF_P
  → General error
  → ERROR in 'pre_compile' handler registered on component 'LPF_P': can't multiply sequence by non-int of type 'float'

I guess that I am doing something wrong and that the Battery ESS (Generic) component is receiving some float variables, which shouldn't be floats. 

Any guidance on how to resolve this issue or any model example where this component is linked with a Modbus interface would be greatly appreciated.

Best regards,

Edit: After further testing, I realized that the baseline CAN interface uses 8 bits for the uint registers, and I can't find a way to use 8-bit registers in Modbus in the Modbus Device documentation. Could the errors be related to this?

Edit-v2: I have uploaded the problematic model to a Google Drive, here: https://drive.google.com/file/d/1bSzvuzA0W2eujwhUGY3COjv7p3GTUtDO/view?usp=drive_link

2 Answers

0 votes
ago by Borisav Živanović (14 points)
Dear Joan,

Such errors can only be caused by a bug in our software. While you model might contain some model-level error, it must be reported in a meaningful way that describes the problem and steps needed to fix it.

Can you please attach the problematic model, so I can reproduce the issue, debug it and fix it?

Best regards,

Borisav Živanović
0 votes
ago by Biljana Tatar (14 points)
There is an example that utilizes Modbus server component inside of BESS (Generic) component. You can find it in example explorer under communication protocols>modbus>client and server components 2 hils.

Of course, you don't need two HIL devices for this, you can just leave part with Modbus server component (second HIL is used just for Modbus Client).

Hope this helps!
ago by Joan Valls Pérez (13 points)
Dear Biljana,

Thank you for your reply. I was not aware that there was this example. I will try to make it work with the generic microgrid.

Best regards,
Welcome to the Typhoon HIL user forum. Please check self-service support resources before posting a question.

HIL Specialist 2.0 courses
Documentation
Knowledgebase (Legacy)
Video support on demand
Youtube tutorials

For subscription-based support visit Typhoon HIL Support Center
...