question

Celia C2 avatar image
0 Likes"
Celia C2 asked Luciano Cavallero commented

Read Holding register from Unity Pro XLS using Emulation

Hi,


I'm trying to read an uint variable from Unity Pro XLS (see screenshot) and with holding register and 16-bit uint in FlexSim it shoukld work but, it didn't. I don't know where the problem is, anyone knows how to fix it? the custom code attached to the variable should write the old and new value on the output console, but this doesn´t work either. I'm using an modbus tcp connection.


Thank you


Flexsim.PNG

Uint_unity.PNG

FlexSim 22.0.4
emulationmodbus
uint-unity.png (1.6 KiB)
flexsim.png (22.7 KiB)
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Celia C2,

It's hard to know how to help without looking at your model. To receive a more accurate solution, please post your model or a sample model that demonstrates your question.

Proprietary models can be posted as a private question visible only to FlexSim U.S. support staff. You can also contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·
Celia C2 avatar image Celia C2 commented ·

Hi Jeanette,

You can find my model attached to this message. Basicly you will see 2 parts of the process flow, one for the connected model and the other for the disconected one. Also, there are emulation variables attached to the 3D model (disconnected one) and another group of them that should listen to the PLC (here's my problem, the one not working is called 'PM').


Thank you for your help.

Prueba_open_5.fsm

0 Likes 0 ·
prueba-open-5.fsm (284.1 KiB)
Luciano Cavallero avatar image Luciano Cavallero Celia C2 commented ·

Hi,

I connected your mode to a Modbus Client (not the Unity Pro XLS) where I configure a Coil register at address 80 and I'm able to read its value using the 'PM' variable.

You screenshot show that in Unit Pro XLS the 'PM' tag is an uint16 but in Flexsim the 'PM' is set as a coil.
Try to change 'PM' to 'Holding Register'.

1 Like 1 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Celia C2,

Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.