07-04-2012 04:37 AM
Hi There
Im working with SCPI but am having some problem clarifying a few points from the IEEE 488.2 and SCPI 99 documents, I hope someone here may have the knowledge to help.
My questions mainly involve the seperators of message unit and command headers
1) some documents I have looked at have specified starting all message units with a colon, others seems to show examples where this is not necessary... is there a reason for this? which is correct?
for example:
(note the colon between COMMand; and SUBSystem2)
:SUBSystem:COMMand;:SUBSystem2:COMMand2;
or
:SUBSystem:COMMand;SUBSystem2:COMMand2;
2) Some examples in the SCPI 99 document seem to suggest that not using the preceding colon allows subsequent commands of the same command path, or level on the tree, to not require the reiteration of that path for each command, is that correct?
for example:
:SUBSystem1:COMMand1_1;COMMand1_2;
is equal to
:SUBSystem1:COMMand1_1;:SUBSystem1:COMMand1_2;
??
3) should a common command (those starting with a *) be preceeded by a colon?
Many Thanks
Solved! Go to Solution.
07-04-2012 09:07 AM
@wolf99 wrote:
Hi There
Im working with SCPI but am having some problem clarifying a few points from the IEEE 488.2 and SCPI 99 documents, I hope someone here may have the knowledge to help.
My questions mainly involve the seperators of message unit and command headers
1) some documents I have looked at have specified starting all message units with a colon, others seems to show examples where this is not necessary... is there a reason for this? which is correct?
for example:
(note the colon between COMMand; and SUBSystem2)
:SUBSystem:COMMand;:SUBSystem2:COMMand2;or
:SUBSystem:COMMand;SUBSystem2:COMMand2;
2) Some examples in the SCPI 99 document seem to suggest that not using the preceding colon allows subsequent commands of the same command path, or level on the tree, to not require the reiteration of that path for each command, is that correct?
for example:
:SUBSystem1:COMMand1_1;COMMand1_2;is equal to
:SUBSystem1:COMMand1_1;:SUBSystem1:COMMand1_2;??
3) should a common command (those starting with a *) be preceeded by a colon?
Many Thanks
It has been awhile since I did SCPI, but here's what I'm quickly gathering from some of my old code. And some instruments are slightly different, so double check with the instrument before diving in head first.
1 & 2. The colon is the start of a command level. Not having the colon lets the instrument know that the command is at the same hierarhcial level. So, yes, you are correct with #2. However, some instruments will take commands without the colon. Power supplies, for example, will sometimes take VOLT 5.0 to set to 5V even though the voltage setting is several layers deep in the command set.
3. No colon needed for the special commands such as *RST and *IDN?.
07-04-2012 09:25 AM
Many thanks, very helpful 🙂
07-05-2012 08:06 AM
This information can also be found in the SCPI spec, also known as SCPI-99. You can find a copy here: http://www.scribd.com/doc/62700781/scpi-99-1
07-05-2012 08:09 AM
As I said in my OP, I am reading this document and the IEEE 488.2 document but was not exactly clear on these specific issues. Thankfully crossruls reply fully expolained it to me.
07-05-2012 08:45 AM
Sorry, missed that part. For reference, this is on page 6-7 of the spec:
Multiple <PROGRAM MESSAGE UNIT> elements may be sent in a <PROGRAM MESSAGE>. The first command is always referenced to the root node. Subsequent commands, however, are referenced to the same tree level as the previous command in a message unit.
08-13-2012 05:43 AM
Hi,
I am having problems executing my configure vi for my power supply. The template provides %.;:VOLT:PROT:STAT %d;:VOLT:PROT %g;
I attempt to input my string off %.;:VOLT:PROT:STAT ON;:VOLT:PROT 48; my vi is still broken. Please advise
Damien
08-13-2012 06:02 AM
I realized i left out the Enable input for the format into string. I am still wondering if my command is correct the error vi is accompanied also.
Thanks
Damien
08-13-2012 06:03 AM
I realized i left out the Enable input for the format into string. I am still wondering if my command is correct the error vi is accompanied also.
Thanks
Damien
08-13-2012 07:46 AM
You are not supplying a boolean value to the format string. So of course it's broken. Also, if you are not using the double in the format, then you shouldn't wire it in.