Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

how to wait for a command to finish

Hi
 
I write a code to control a signal generator through Ethernet. At the signal generator, I have to load pattern, then select pattern from the memory. It takes a while to load the pattern so before I can select a pattern, I have to wait till pattern loading is done. I tried sending  *OPC?  (and wait till response is 1), but it doesn't work. I get 1 before pattern loading is done. Do you have any idea what I should do to know when the signal generator is done pattern loading? (I tried putting the delay between loading pattern and selecting pattern. It works, but I wonder if there's a better way to synchronize this)
 
I attached the instruction from the manual on how to synchronize the signal generator with the controller. The manual said there are 2 ways, the first one is the OPC, and the Second one is SRQ. But I didn't try SRQ because I think it's IEEE488.2 (GPIB) standard (while I'm using Ethernet)
 
Thanks  
0 Kudos
Message 1 of 2
(6,606 Views)

Hi L_K,

I believe that you are correct in regards to using the SRQ line with Ethernet - I have not seen this combintation used before.  From the excerpt of the user manual that you posted, I would have expected something like the OPC command to work - but clearly the task appears done before it truly is.  Have you been able to use the OPC command successfully with any other command sequences?  In general, this may be something that you will want to ask of the manufacturer of the signal generator as well, as they should have more information concerning the pattern loading process.  Hopefully they would have some insight on how to determine when the process is complete.  Hope this helps!


Regards,
Anna M.
National Instruments
0 Kudos
Message 2 of 2
(6,567 Views)