Problems to receive data from PLC using Modbus

Problems to receive data from PLC using Modbus

adna_l2
Not applicable
421 Views
13 Replies
Message 1 of 14

Problems to receive data from PLC using Modbus

adna_l2
Not applicable

[ FlexSim 22.2.3 ]

Hi, I'm having a problem to receive data using Modbus protocol

Variables of type "Coil" are assuming integer values >1 in Flexsim, which impacts the identification of information arrival in some variables.


We noticed that in the first moments of simulation the information is received correctly and after a certain interval the values start to change randomly. I saw something similar in this question: https://answers.flexsim.com/questions/122489/modbus-control-register-read.html


I'm using a Modbus TCP Connection with a Delta AS228P PLC. Flexsim version is 22.2.3. And to check the receipt of data from the PLC I used the "Wireshark" program, at first the PLC sends the data correctly, but Flexsim is not receiving it in the proper format.

In this model I tested the same variable with the 4 types possibles


By reading a boolean variable referring to a light sensor I obtained this data. The first column refers to the received data and the second to the Model.time.

variable-500-sensor-out.png


Would it be a bug? Or would there be some other configuration needed?


Teste_Endereço_Modbus.fsm

0 Likes
422 Views
13 Replies
Replies (13)
Message 2 of 14

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Adna Lima,

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
Message 3 of 14

lcavallero
Advocate
Advocate

Hi Adna,

Meanwhile I tried your model with a Flexsim 22.2.3 and Flexsim 2023 with a Modbus Client (not your PLC model) and I able to receive data.

if you haven't already fixed the problem could you use this modbus scanner (https://store.chipkin.com/products/tools/cas-modbus-scanner) to see Flexsim-PLC communication and share the results?



Message 4 of 14

adna_l2
Not applicable

Hi Luciano!


We ran several tests and initially all presented the reading of variables correctly, however, after a few minutes, Flexsim began to present this oscillation when receiving the values of variables of the COIL type. Such a problem is not evidenced and reported as an error in the interface by the Flexsim program, also making it difficult to analyze the root cause of the problem during the tests. To identify this error, after several tests, it was necessary to open the Emulation tree showing the value of the variables and follow one by one of these variables involved in the test.


We used a scanner program called "wireshark" and the test showed that the PLC is sending correctly since Wireshark was able to read the variables and their changes correctly during the test execution. Raising the possibility of error in other topics, such as the error may be in Flexsim at the time of receiving information.


1675349643062.png


During the test with the PLC via Wi-Fi, a timeout was detected when receiving data "Request timeout" (Figure below), thus, it was necessary to adopt a Change Interval > 1 in Flexsim for data detection, so there were no problems in the variable readings.


1675349668462.png


During the testing process, it was noticed that replacing the wireless communication network (WIFI) with wired communication (Ethernet) minimizes the occurrence of errors. Therefore, the use of a wired network for interconnection between the FlexSim simulator and the PLC was recommended.


But I didn't try the 2023 version yet.

0 Likes
Message 5 of 14

Jeanette_Fullmer
Community Manager
Community Manager
Hello @Luciano Cavallero, Can you provide @Adna Lima support?
0 Likes
Message 6 of 14

lcavallero
Advocate
Advocate
Hi Adna,

thanks for the information: I'm investigating the issue

0 Likes
Message 7 of 14

Jeanette_Fullmer
Community Manager
Community Manager
Hello @Luciano Cavallero,

Any update?

0 Likes
Message 8 of 14

lcavallero
Advocate
Advocate

Hi Adna.

Sorry, but may be that I didn't correctly understand.
Do you no longer have communication problems by replacing a wireless connection with a wired one?

0 Likes
Message 9 of 14

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Adna Lima,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment 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
Message 10 of 14

adna_l2
Not applicable

Hi Luciano!


Yes, it really this, with Ethernet cable I didn't broke the connection and the variables were correct received.


But using the wi fi connection the Flexsim console didn't show me the problem with the variable.

0 Likes
Message 11 of 14

lcavallero
Advocate
Advocate
HI Adna,


thanks for your feed back.
I'll try do some further test with wifi connection.




0 Likes
Message 12 of 14

Jeanette_Fullmer
Community Manager
Community Manager
Hello @Luciano Cavallero , @Fiorenzo A, @Tancredi Canonico, Has there been progress on this or feedback to give?
0 Likes
Message 13 of 14

jason_lightfoot_adsk
Autodesk
Autodesk

@Luciano Cavallero , @Tancredi Canonico @Adna Lima

Has anything progressed with this issue to help get it resolved? Can we close the question (~4months old now)?

0 Likes
Message 14 of 14

adna_l2
Not applicable

I still waiting the test with wifi connection, but here I solved the problem using the Ethernet cable.


The question can be closed.

0 Likes