//Read the Status Byte of Service Request Status Register
StatusByteFlags sb = mbSession.ReadStatusByte();
string responseString = null;
string errorString = null;
while (((int)sb & (b2 + b4)) == 0)
{
Thread.Sleep(10);
sb = mbSession.ReadStatusByte();
}
if (((int)sb & b2) != 0)
{
errorString = mbSession.Query("OGE\n");
Console.WriteLine("Error Queue: " + errorString);
}
else if (((int)sb & b4) != 0)
{
responseString = mbSession.ReadString();
}
mbSession.Write("*CLS\n");
return responseString;
}
}
}
Example 3 – Discussion
1. This and the next few examples do not write anything to the Console unless there is an error. Output is sent to file in the same directory of the running program (\Example3\Bin\Debug\List.txt).
Example 3 – VectorStar Command Listing
The List of all commands supported by VectorStar.
2. Use LANG LIGHT. Lightning has the same command but is comma-delimited:
//Set the Language to LIGHTNING and send the LIST command
mbSession.Write("LANG LIGHT\n");
mbSession.Write("LIST\n");
responseString = testStatus_Read(mbSession);
//the results are delimited by a comma
split = responseString.Split(',');
3. Use WGPIB to get more help on any command.
Example 3 – WGPIB Help Command Description
Help will tell you what type of command (Lightning, Native, 8510) you are asking about and provides syntax.