Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How can we concatenate multiple SCPI commands to be sent in one IVI callback?

We are developing an ivi driver and the problem that we have is that the template can send only one parameter per callback (in each callback, only one attribute is changed) but we need to send , for example, the amplitude and range of a signal. The template can send the amplitude with one callback and the range with another callback but not both in the same SCPI command. How can we store the first part of the command to concatenate it with the next part of the commnad and then send it to the instrument?
0 Kudos
Message 1 of 2
(4,657 Views)
In 95% of callbacks is used one command per callbacks. This is reason why template shows this example, but this not RULE. My experience is that is better used one command for one attribute, because it does not make so many troubles witch cache. I try describe two tricks, how you can solve this problem.

- TRICK 1 --------------------------------------------
Value of your public attribute is combination of two commands (XXX:YYY and WWW:ZZZ ). In this case you can create two hidden attributes for your commands. Your public attribute sets/gets these hidden attributes. Use following flags for public attributes: IVI_VAL_DONT_CHECK_STATUS | IVI_VAL_USE_CALLBACKS_FOR_SIMULATION | IVI_VAL_NEVER_CACHE.

Reason are following:
Never Cache - v
alues are cached in your hidden attributes. You do not need cache again. This can be source of troubles if you store one value on two places.
Use for simulation: - Your callbacks do not write/read data to/from instrument and it only sets other attributes. This must be simulated.
Don't Check Status: - Because callbacks does not write/read data to/from instrument you do not need check status. This attribute cannot make any error in the instrument, because callback does not send any data to instrument.

One Suggestion: All checking should be in public attribute. Do not implement check callbacks for hidden attributes.

- TRICK 2 ---------------------------------------------
One command sets two values. (UUU:QQQ ,) In this case implement one hidden attribute type of ViString and two public attributes. Your public attributes gets second attribute, build parameter of string attribue and sets string attribute. These public attributes has flags: IVI_VAL_DONT_CHECK_STATUS
| IVI_VAL_USE_CALLBACKS_FOR_SIMULATION | IVI_VAL_NEVER_CACHE. Reason is above.

See attached example.

Regards,
Zdenek
0 Kudos
Message 2 of 2
(4,657 Views)