LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

vxlapi timer limit

Hello,

 

I'm currently using the Vector XL Driver by TroyK with vxlapi dll,

I want to send repeated frames but when my loop timing is around 20-100 ms it skips some frames and I cannot allow it,

I think it takes a lot of time to open driver, open port, send info, close port, close driver ... again and again, but I don't know how I can make it run faster...

Thanks for your help,

 

Mathieu

0 Kudos
Message 1 of 5
(2,862 Views)

I don't have any experience with you particular dll, but the basic process is simple - assuming of course the DLL let's you do it. Assuming a loop that is doing the main work of your VI over and over again, you put the logic to open references (open driver, open port) outside the loop to the left. Pass the port reference into the loop and use it over and over to "send info". Finally, when the loop stops, pass the reference back out of the loop and execute the deinitialization logic (close port, close driver).

 

There are countless variations on the theme, but that's the basic idea.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(2,850 Views)

Hello Mike,

 

I tried to do it before but I get an error when the open port is not close to the send data VI...  but it works to send data,

when I use a timed loop it still misses some frames, and when I use a while with a Wait (ms) inside it does the same things,

the thing is when I don't use a wait function to "clock" the send data VI the data are sent at full speed every 4 ms without loosing data ... weird ?

0 Kudos
Message 3 of 5
(2,843 Views)

can you post your code, or if not too complicated, an image of the part your having trouble with? Please no *.bmp format, *.png is prefered.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 4 of 5
(2,825 Views)

Please attach your code if possible. It will be easier to help that way.

 

From what you have described, it seems like you are opening then closing driver and port and channel inside the timed loop.

Try opening the driver, port, channel outside the loop, then just call the send command inside the loop, then close them when you're finished sending.

 

If you do it that way you can blast out CAN frames as fast as the bus speed and loading will allow.

If you try to send out messages faster than is possible for the bus speed, the transmit buffer will fill up until you get a transmit buffer full error.

 

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 5 of 5
(2,773 Views)