Questions about cyclic messages using the Worker class.
Posted: Tue 3. Dec 2024, 18:46
Hello,
I am developing a C# wrapper to the worker class to be able to collect data (with DeQueue) and send cyclic message (with broadcast) or single message (with transmit).
I have to make an easy-to-use library which can be used in software like TestStand.
So far, the stability of the cyclic messages looks quite good. I would say +/-3ms whatever the cyclic rate is. I have tested several hours with 10 messages simultaneously with a cyclic rate from 10ms to 1000ms.
I would like to ask to the experienced users, how stable are the cyclic messages when testing during days with a lot of messages (such as 50 or even 100 messages)? I can see that the maximum amount of cyclic message possible is 100.
I guess that if a lot of "Transmit" would be called, it could impact the stability of the cyclic messages, but in my previous question you can consider that "Transmit" is not being used (or only few messages per seconds).
And, if the PC has a big lag, could it impact this cyclic rate? Or this broadcast happens in "embedded" within the PCAN device (such as PCAN-USB Pro)?
Also, is it possible to have dynamic data in the broadcast? Specifically, I would like to support some CAN messages with alive counter and checksum within the CAN data (other data would be fixed).
I can only find the method "UpdateBroadcast" but I don't think it's really suitable for modifying the CAN message content manually between each time that the CAN message is sent.
Especially my main script would not know when a specific CAN message has already been sent by the Worker class... Except if there is a way to send an event every time a specific CAN message inside the broadcast is sent out?
Then I could catch the event, and update the alive counter and checksum bytes with "UpdateBroadcast" before the next cycle of the CAN message. I guess that could work even for a CAN message with 10ms scheduling.
Alternatively, I could make my own cyclic message when I need this dynamic data, using "System.Timer" and the method "Transmit", but I have already tested and the cyclic rate is not very stable for a 10ms scheduling when using System.Timer...
I am of course open to any other suggestions
.
I am developing a C# wrapper to the worker class to be able to collect data (with DeQueue) and send cyclic message (with broadcast) or single message (with transmit).
I have to make an easy-to-use library which can be used in software like TestStand.
So far, the stability of the cyclic messages looks quite good. I would say +/-3ms whatever the cyclic rate is. I have tested several hours with 10 messages simultaneously with a cyclic rate from 10ms to 1000ms.
I would like to ask to the experienced users, how stable are the cyclic messages when testing during days with a lot of messages (such as 50 or even 100 messages)? I can see that the maximum amount of cyclic message possible is 100.
I guess that if a lot of "Transmit" would be called, it could impact the stability of the cyclic messages, but in my previous question you can consider that "Transmit" is not being used (or only few messages per seconds).
And, if the PC has a big lag, could it impact this cyclic rate? Or this broadcast happens in "embedded" within the PCAN device (such as PCAN-USB Pro)?
Also, is it possible to have dynamic data in the broadcast? Specifically, I would like to support some CAN messages with alive counter and checksum within the CAN data (other data would be fixed).
I can only find the method "UpdateBroadcast" but I don't think it's really suitable for modifying the CAN message content manually between each time that the CAN message is sent.
Especially my main script would not know when a specific CAN message has already been sent by the Worker class... Except if there is a way to send an event every time a specific CAN message inside the broadcast is sent out?
Then I could catch the event, and update the alive counter and checksum bytes with "UpdateBroadcast" before the next cycle of the CAN message. I guess that could work even for a CAN message with 10ms scheduling.
Alternatively, I could make my own cyclic message when I need this dynamic data, using "System.Timer" and the method "Transmit", but I have already tested and the cyclic rate is not very stable for a 10ms scheduling when using System.Timer...
I am of course open to any other suggestions
