I work with a radio station and I'm researching and working with using a new device to pulse some relays.
The device we are looking at is a broadcast tools src-8 III serial remote control.
It’s a pretty cool device.
I’ve been writing a Procomm Aspect script to transmit pulses to the device which will cause the relays to pulse.
I’ve had a lot of success with the scripts and the testing.
Without boring you with what we are trying to do…
We have this long sequence of events which we are trying to program these pulses for…
I’ll be happy to post some of the stuff we've been testing – but the main problem I’ve been having is getting the aspect script to work with $Time.
For example, at 5:30 in the AM, the Board Operator in the Studio is supposed to punch this button which will send this closure to the serial port on a PC.
I can put aspect in a waiting state using :
waitfor "S0P,A,1,0,0,0,0,0,0,0"
waitfor "S0P,A,0,0,0,0,0,0,0,0"
It actually works quite well – waiting and “listening” on the COM port.
When it “hears” that response, it’s supposed to transmit the following:
transmit "*0OR1P^M"
This actually works quite well also.
Then, the Aspect script is supposed to wait for 40 seconds and transmit another pulse… wait till 5:35 and send another pulse… wait for 4 more minutes and send another pulse.
These are all working quite well.
The problem I’m having is that we don’t want to assume the board op is going to push the button when they are supposed to at 5:30 to start this whole thing. In addition, if he doesn't push the button when he is supposed to, and finally remebers to push it later, I don't want the script to start firing off transmits out of sequence.
So I’m trying to write into the script to listen for the two inputs ( waitfor "S0P,A,1,0,0,0,0,0,0,0" and waitfor "S0P,A,0,0,0,0,0,0,0,0" ) but if it doesn’t hear anything by 5:30:15, to go ahead and stop listening and transmit the pulse anyway. Or if it finally hears the pulse, to check the time, and if it is within a certain window to either wait to begin it's sequence or jump to the next module.
The problem is that everytime I try to write and compile an if statement to read the current machine time, and wait till 5:30:15, I get an error that says invalid variable operand and invalid number.
Some of the code I’m using looks like this:
;test if statement
if $Time <= "5:30:15" ;test current time and listen on COMM Port if time less than or equal to 5:30:15
waitfor "S0P,A,1,0,0,0,0,0,0,0"
waitfor "S0P,A,0,0,0,0,0,0,0,0"
transmit "*0OR1P^M"
else
waituntil 5:34:00
transmit "*0OR1P^M"
endif
Does any of this make any sense?
Can I not do what I’m trying to do with the $Time?
Thanks for any help you can provide.
The device we are looking at is a broadcast tools src-8 III serial remote control.
It’s a pretty cool device.
I’ve been writing a Procomm Aspect script to transmit pulses to the device which will cause the relays to pulse.
I’ve had a lot of success with the scripts and the testing.
Without boring you with what we are trying to do…
We have this long sequence of events which we are trying to program these pulses for…
I’ll be happy to post some of the stuff we've been testing – but the main problem I’ve been having is getting the aspect script to work with $Time.
For example, at 5:30 in the AM, the Board Operator in the Studio is supposed to punch this button which will send this closure to the serial port on a PC.
I can put aspect in a waiting state using :
waitfor "S0P,A,1,0,0,0,0,0,0,0"
waitfor "S0P,A,0,0,0,0,0,0,0,0"
It actually works quite well – waiting and “listening” on the COM port.
When it “hears” that response, it’s supposed to transmit the following:
transmit "*0OR1P^M"
This actually works quite well also.
Then, the Aspect script is supposed to wait for 40 seconds and transmit another pulse… wait till 5:35 and send another pulse… wait for 4 more minutes and send another pulse.
These are all working quite well.
The problem I’m having is that we don’t want to assume the board op is going to push the button when they are supposed to at 5:30 to start this whole thing. In addition, if he doesn't push the button when he is supposed to, and finally remebers to push it later, I don't want the script to start firing off transmits out of sequence.
So I’m trying to write into the script to listen for the two inputs ( waitfor "S0P,A,1,0,0,0,0,0,0,0" and waitfor "S0P,A,0,0,0,0,0,0,0,0" ) but if it doesn’t hear anything by 5:30:15, to go ahead and stop listening and transmit the pulse anyway. Or if it finally hears the pulse, to check the time, and if it is within a certain window to either wait to begin it's sequence or jump to the next module.
The problem is that everytime I try to write and compile an if statement to read the current machine time, and wait till 5:30:15, I get an error that says invalid variable operand and invalid number.
Some of the code I’m using looks like this:
;test if statement
if $Time <= "5:30:15" ;test current time and listen on COMM Port if time less than or equal to 5:30:15
waitfor "S0P,A,1,0,0,0,0,0,0,0"
waitfor "S0P,A,0,0,0,0,0,0,0,0"
transmit "*0OR1P^M"
else
waituntil 5:34:00
transmit "*0OR1P^M"
endif
Does any of this make any sense?
Can I not do what I’m trying to do with the $Time?
Thanks for any help you can provide.