11-19-2008 05:18 PM
Are RT-Fifo Queues better to use than the Normal Queues (Enqueue and Dequeue) on the RT Controller ? I'm still getting data loss and when I put the normal Queues size too big, there's a Lag that appears between the RT-Controller data and the data received on the Host PC. The array of data (from CAN) that I send into the Queue is around 1408 (this number should normally be around 352 when counting it as it represents 16 frames) elements of U32 every 2.5ms. I've set my Shared Variables at 2 arrays of 2048 Elements. The loop of the SV is every 10ms. When a new data is received on the RT Controller from the CAN, it takes around 9-10 seconds before I see the change on the Host PC...
So I tried quickly replacing all the Normal Queues for RT-FIFO and no data even gets transfered through the SV (the data is still sent to the SV on the RT-controller) and the RT Controller is topped at 100%. When I look at RT-FIFO examples, they seem to be implemented exaclty like the Normal Queues.
11-20-2008 09:58 AM
Hello foreshadow,
Real-Time FIFO Functions Dim hasPlayer, playerversion hasPlayer = false playerversion = 10 Do While playerversion > 0 On Error Resume Next hasPlayer = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & playerversion))) If hasPlayer = true Then Exit Do playerversion = playerversion - 1 Loop is_FlashVersion = playerversion is_Flash = hasPlayer
The Real-Time FIFO functions are used to send and receive data deterministically between VIs. RT FIFO functions provide a deterministic data transfer method that does not add jitter to a time-critical VI. An RT FIFO is a lossy form of communication that overwrites the oldest data element when the FIFO is full.
Would it be possible to post your code? Thanks.
11-20-2008 01:13 PM
Since you said that RT-FIFO is data that can be lost, I went back with the normal Queues. Here is the code.
11-21-2008 10:02 AM
11-21-2008 01:59 PM
Here is an update of the code. I'm still getting data loss as explained in the previous post.
The second picture is part of the vi on the Host PC. There is 2 timed loops identical. I've only put the SV and the basics of the diagram. The rest is non important and doesn't affect the program's timing.
11-21-2008 03:11 PM
Hello foreshadow,
What is the size of your queue?
11-21-2008 04:23 PM
4096 elements for each CAN channel.
I count it as every 2.5ms I get 16 frames wich each contains an array of 22 U8 elements. +4Lenght + 4TickCount. So 16*22 + 4 +4 = 360. Each write to Pc is 10 times (25/2.5) so 4096 to make it a round number.11-21-2008 04:34 PM
When I put the Loop on the Host PC at 1ms, I seem to get almost everything, but data get jumped around when I verify the binary written file.
I think i'll add Queues on the Host PC side. I don't have time to test this at this moment, but monday I'll try to use 2 normal loops in parallel inside of 1 large loop. 1 to read and buffer and another to empty the Queue, both in 1 large loop.