11-02-2014 09:48 PM
I used data flow to write and read values. The problem is, when I open Highlight Execution, the returned value from VISA Read is correct, when I close Highligh Execution, the returned value is wrong.
I was wondering if it is when the Highlight Execution is closed, the program runs too fast, and doesn't follow the sequence of the structure (data flow). Because I need to manipulate the value from VISA read, so the returned value is very important. But if I open Highlight Execution, the program is too slow.
Does anyone know how to fix this problem?
11-02-2014 09:53 PM
Highlight execution doesn't break dataflow.
If your program is running too fast, then you might need some delays sequenced in with the other items. It looks to me like you are running a lot of VISA writes in a row. Perhaps your device can't hanldle them at high speed.
11-03-2014 02:58 AM
If the VISA Read VIs read replies initiated by the preceding Write, you will need some delay right after the Write call. Depending on the device it may be 20-30 milliseconds, but it can be 200+ milliseconds. Sometimes you can find information in the device manual or just try what works best.
11-03-2014 06:44 AM
Instruments can be very slow at processing commands. I highly recommend adding a delay after every VISA Write. 50ms tends to be a good wait for most instruments. I have an oscilloscope that needs more like 500ms (depending on the command).
11-03-2014 07:07 AM
If it's SCPI compliant you can also make use of the *OPC? command which turns your command into a query. That way your code only waits long enough for the equipment to reply before moving on. It doesn't have to wait the maximum expected delay every time. (Caveat: even if the equipment is SCPI compliant, you have to read the programmer's guide to tell you which commands support it.)
Saving a few hundred milliseconds doesn't seem like a lot until you have a test that runs for days and you are constantly talking to the equipment. Sometimes you can shave HOURS off a test like that. That becomes important if your UUT has a burn in spec.