How to trap return codes ?

V3 help and support questions

How to trap return codes ?

Postby sdumas on Thu Jul 31, 2008 10:47 pm

Hi Everyone,

I have a pre-amp that is controllable via RS-232. I can see that in the RS-232 events it allows you to have a variable there. I put "powertest" as the variable name.

I send a command to my pre-amp to turn it on. I know that the pre-amp returns a value after it executed the command. Does that value get stored in the variable? If so, how do I retreive it to display on a menu. I created a test box with the name "%powertest%". Is this sufficient? (currently it returns/displays nothing to me)

Now for a more complicated question: The system will return a code that is not human friendly. How can I match one of those code to a human-friendly name?
ex. I send !1PWR01\r - pre-amp return TAG1PWR01 - which means that the power is on. How can I match TAG1PWR01 to display POWER ON in a text box?

Thanks!

PS - using the search I haven't found a "how to" for using variables.
sdumas
 
Posts: 131
Joined: Tue Aug 05, 2003 8:15 pm

Re: How to trap return codes ?

Postby sdumas on Fri Aug 01, 2008 2:03 am

OK - I got part of it.

I can display the variable name in a text box.

It was as simple as "%variable>powerstatus%" - that was enough to display the return code from my pre-amp.

Now I need to "match it" to a real meaning.

ie. return code is 1PWR01 - real meaning is Powered ON.

How can I perform a sort of "If / Then" statement?
If powerstatus = "1PWR01" then powerstatus = "Powered ON"
If powerstatus = "1PWR00" then powerstatus = "Powered OFF"
etc...
sdumas
 
Posts: 131
Joined: Tue Aug 05, 2003 8:15 pm