Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Cancelling or Stopping Reading Data Command in NI GPIB RS-232

Hi All,

I need your help in my issue here. Well it's not really an issue but I'm just wondering if it's possible. Really appreciate if anyone can help.

 

I have NI GPIB RS-232 to communicate with my target instrument (I refer to it as 'tester'). I develop my program in Visual C++

The GPIB is used in between machine handler and tester. If the machine handler already send rd command (to read data) to GPIB, but before the machine handler receive reply from GPIB, or before the timeout (tmo):

a. how the machine handler can cancel the rd command by itself?
b. what is the command the machine handler can send to GPIB to cancel the read data state?

 

Basically in my case, after handler send the read command RD# to GPIB, it need to cancel it at anytime without wait for the response from tester or the timeout tmo from the GPIB itself. So is there any method can do this?

 

Thanks very much for your time!

0 Kudos
Message 1 of 3
(3,361 Views)

Someone else can probably offer better solutions, but any options that might be will probably greatly slow down communications and could cause some problems especially if in the ensuing time something else comes that you do need to process it could be skipped accidentally as well.  I can see how it might be possible that you could use "events" to trigger special cases and manually activate or deactivate the trigger RTS or request to send and the CTS or clear to send signal or manually change and thus fool the transmitted and/or received data signals.  You could also probably use the command queue capabilities of some instruments and the priority commands to remove the item from the queue, but then you would have to have some means of keeping track of it.

 

The basic option would be to manually buffer the commands and hold processing them or sending them or use signals to say to discard the received data rather than half the actual reception as more than likely it will have been sent and received already even on a serial bus before the action code to change things can be triggered.  You could possibly use named timed loops with a timing interval set to the timeout period you want and use those to do the reads in which case you can use a faster or shorter interval timed loop to check for the conditions to cancel it and then you can have that say to terminate that instance of the named loop.

 

However, while it says it should be possible, I've had problems myself getting the timed loops to terminate right then.  Again though, it is supposed to be possible to get it to stop instantly.  At the least you could maybe add frames to the timed loop and add a wait at the start for most of the cycle and use a true/false case to enable or disable the code to better the chance to prevent execution of the code.

 

I think it would be easier to just tell the code or device to ignore the data.

 

-Leif

0 Kudos
Message 2 of 3
(3,350 Views)

You might need to delve into the actual RS232 Standard documents that define the Standard and Requirements for RS232 communications and then relate that to the LabVIEW functions available or commands for sending specific sequences on specific pins.  You might even have to use the RS232 more like the modem like communication functionality items rather than treating it as a regular data port.

0 Kudos
Message 3 of 3
(3,349 Views)