11-17-2015 10:37 AM
Hey guys!
I have an odd problem I'd love some help on.
I'm writing from a NI-9862 card that's in a cDAQ 9188 chassis to a CAN device within the network. I'm trying to implement a command/response architecture with the device to verify the command has been successful. Please find the attached block diagram to see the code.
Question:
Everytime I try to write, then read the response from the device, I don't see anything from CAN Read ONLY the very first time it's called. After that it works like a champion. I tried playing with the wait times of the Wait function, the loop wait, the timeout values...pretty much everything I could think of. I opened up the NI-XNET bus monitor and confirmed that I am indeed getting a response back from the device, however, my code doesn't reflect this. Interestingly, when I run the NI-XNET read VI in a loop of it's own, it reads it just fine.
Hopefully one of you guys can give me a pointer or two 🙂
Thanks!
Solved! Go to Solution.
11-18-2015 06:01 PM
Have you tried putting the read before the write in the loop? Sometimes I've seen this fix weird issues like this. It looks like in the example 'CAN Frame Input Output Same Port Single Point.vi' this is how they do it.
11-19-2015 09:44 AM
Call start first. XNET impliictly starts on I/O access (write/read). You are calling write first (starting the writer) then calling read (starting the reader). If you want the reader started before the first write, call Start on the read session outside of the loop.
11-19-2015 10:11 AM
worked like a charm! Thanks so much