09-18-2013 02:53 AM
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
09-18-2013 04:04 AM
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...
09-18-2013 04:33 AM
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 ?
09-18-2013 10:00 AM
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.
10-14-2013 02:08 AM
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.