LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt VISA

This one DOES drop data.

[Molly K] Removed attachment per user request.

Message Edited by Molly K on 02-22-2005 03:25 PM

0 Kudos
Message 11 of 17
(1,004 Views)
I never worked with 485, only 232 and I only had a quick view at the VI, but I'd like to ask two questions. First, is "FC" something I'm unaware of? It looks like you're reading one byte and comparing it to a string of 2 bytes. This should always be false. Second, what would happen if you put the VISA write in the same loop as the read? Is it possible that running them in parallel causes trouble? I suggest you try this at least. That's the way I work with TCP - one loop for comm - both writing and reading - that way I know for sure things don't get messed up.

___________________
Try to take over the world!
Message 12 of 17
(998 Views)
Check out the FC again - it's simply a string displayed in hex. Remember, the "packet" format is:

Header, length, command, data, for example:

FC, 0004, C100, 0102 0203

The header is always 0xFC, the length is always two bytes, and of course the data. One thing I think *might* be saving some time is that the header, length, and command are read (in the original) and then control is transferred to the appropriate case. That case reads the data, which actually would be faster.

Jason
PS Please delete these posts once you have read/downloaded them. Ideally, I'd like NOT to keep it here too long.
0 Kudos
Message 13 of 17
(997 Views)
If you want the posts to be deleted, you should actively inform an admin. Send them an email, or more simply, click on the options menu of your last post and select "report to a moderator".

___________________
Try to take over the world!
Message 14 of 17
(996 Views)
Also, I suggest you ask them to cancel only the posts with your code, as people can learn from this thread in the future (plus I don't want to be set back).

___________________
Try to take over the world!
Message 15 of 17
(989 Views)
Thanks, yes, I did that. If you don't mind, perhaps I could simply send something via email. What I posted is not the absolute latest.

Jason
0 Kudos
Message 16 of 17
(983 Views)
After thinking about it, the one main problem I have here that prevents me from reading a LOT of data at once is that I have to use the 2 length bytes to determine how much data to read. If I were doing this in 'C', I would do it this way:

1. Set up a serial port ISR to read the data into a buffer (using FIFO, etc.)
2. Have the end of the ISR trigger a network packet state machine for parsing the packet
3. Have the packet state machine "post" (in this case, enqueue) the command and data for processing
4. Have a separate subroutine that processes and responds to commands

I am trying to do something here similar.

Jason
0 Kudos
Message 17 of 17
(978 Views)