11/21/2019 4:30 PM | |
Joined: 8/5/2019 Last visit: 4/17/2024 Posts: 6 Rating: (0) |
Good morning, everyone, This is my first post on this forum, so if I break any rules, please tell me I will. I'm experimenting in my company trying to communicate an ET200SP and a custom accelerometer board (so don't ask me for a datasheet because unfortunately I can't give it to you (). The accelerometer works mainly in this way:
The number of arrays that will be sent to the PLC depends on the "Start" duration that has been sent by the PLC. In particular, the FIRST array that it sends to the PLC contains a data concerning the total number of arrays that will be sent immediately after to the PLC. To divide all the various arrays and store them in the PLC in Tia Portal (15.1) I tried the following solution (working): Arrival of the 2nd array (we discard the FIRST one that does not contain any data about the acceleration values), I compare the 2nd byte of the array with a fixed number (1,2,3...), if the fixed number corresponds to the 2nd byte of the newly arrived array I save it in an Array declared in a PLC DB, and so on for all the other arrays that will arrive to me; one arrives, the comparison is saved, another arrives, the comparison is saved etc... The problem I have now (and let's get to the point) is that I don't know technically how to create arrays at the moment that will depend on the length of the reading made by the accelerometer. In fact, as I think you have understood if the "Start" lasts 10s I will get Tot array, if it lasts 20s I will get Tot+n array. I enclose explanatory images to better clarify what comes to me IMAGES: UDP IMAGES P.S. to make the connection between PLC and Accelerometer I use a TCON block to establish the connection, a TUSEND block to send the data "0" and a TURCV block to receive the avalanche of arrays in UDP AttachmentUDP.zip (27 Downloads) |
Last edited by: l.carminati at: 11/21/2019 16:31:17Last edited by: l.carminati at: 11/22/2019 08:41:35Last edited by: l.carminati at: 11/22/2019 08:42:33Last edited by: Jen_Moderator at: 11/22/2019 12:54:29Removed link and added files as an attachment. |
|
Follow us on