Device Power Sequences
staticattic
Posts: 200
I have a job that requires control of 2 different classifications of codecs. The system utilizes both a Top Secret Tandberg and a Secret Tandberg. There is only one camera and one microphone that both need to share. In order to prevent data spillage, there are certain steps that need to be followed in order to power up / down, or switch codecs. Since the codecs both share the same camera and microphone, there is a 232 A/B switch between the codecs and the camera and mics. This switch is relay controlled and provides feedback on the IO ports. Here's the general sequence:
1- The A/B switch must be switched to the proper codec.
2- Verify the switch is in the proper position via the IO ports.
3- Once verified, power on the proper codec.
Things to check for:
1- Ensure one codec is powered off before the other is powered on via IO ports and a PCS on each codec.
2- At no time should both codecs ever be powered on together.
3- If one codec is on and the A/B switch goes to the wrong position, the system must power down.
This is a first for me, so here's what I did:
And the TIMELINE that kicks it all off:
Upon initial testing on my desk, it seems to work like it is supposed to. I was hoping for another set of eyes to look it over to see if I overlooked any "what if" type situations. I also wanted to know if there was a more correct way to do this instead of a bunch of WAIT_UNTIL's. Thanks.
1- The A/B switch must be switched to the proper codec.
2- Verify the switch is in the proper position via the IO ports.
3- Once verified, power on the proper codec.
Things to check for:
1- Ensure one codec is powered off before the other is powered on via IO ports and a PCS on each codec.
2- At no time should both codecs ever be powered on together.
3- If one codec is on and the A/B switch goes to the wrong position, the system must power down.
This is a first for me, so here's what I did:
DEFINE_CALL 'EMERGENCY_SHUTDOWN' { nEMERGENCY = 1 TIMELINE_KILL(TL1) OFF[dvREL,1] // A/B Switch OFF[dvREL,2] OFF[dvREL,3] // SECRET codec OFF[dvREL,4] // TOP SECRET codec SEND_COMMAND dvTP,'@PPA-' SEND_COMMAND dvTP,'PAGE-WARNING PAGE' } .... DATA_EVENT[dvIO] { ONLINE: { SEND_COMMAND dvIO,'SET INPUT 1 LOW' SEND_COMMAND dvIO,'SET INPUT 2 LOW' SEND_COMMAND dvIO,'SET INPUT 3 LOW' SEND_COMMAND dvIO,'SET INPUT 4 LOW' SEND_COMMAND dvIO,'SET INPUT 5 LOW' SEND_COMMAND dvIO,'SET INPUT 6 LOW' SEND_COMMAND dvIO,'SET INPUT 7 LOW' SEND_COMMAND dvIO,'SET INPUT 8 LOW' } } .... CHANNEL_EVENT[dvIO,1] // Camera / Mic A/B Switch CHANNEL_EVENT[dvIO,2] // TS = Both Off / SECRET = Both On { ON: { nIOTEST = 1 IF(nTS_POWER) { CALL 'EMERGENCY_SHUTDOWN' } } OFF: { nIOTEST = 0 IF(nSECRET_POWER) { CALL 'EMERGENCY_SHUTDOWN' } } } CHANNEL_EVENT[dvIO,3] // SECRET Power Monitor { ON: { CANCEL_WAIT 'SECRET Power Check' WAIT 30 'SECRET Power Check' { IF([dvIO,3]) { nSECRET_POWER = 1 IF(nTS_POWER) { CALL 'EMERGENCY_SHUTDOWN' } } } } OFF: { CANCEL_WAIT 'SECRET Power Check' WAIT 30 'SECRET Power Check' { IF(![dvIO,3]) { nSECRET_POWER = 0 } } } } CHANNEL_EVENT[dvIO,4] // TS Power Monitor { ON: { CANCEL_WAIT 'TS Power Check' WAIT 30 'TS Power Check' { IF([dvIO,4]) { nTS_POWER = 1 IF(nSECRET_POWER) { CALL 'EMERGENCY_SHUTDOWN' } } } } OFF: { CANCEL_WAIT 'TS Power Check' WAIT 30 'TS Power Check' { IF(![dvIO,4]) { nTS_POWER = 0 } } } }
And the TIMELINE that kicks it all off:
TIMELINE_EVENT[TL1] // Timeline for starting VTC Mode { SWITCH(TIMELINE.SEQUENCE) { CASE 1: //0 Seconds { SEND_COMMAND dvTP,'@PPN-power_waiting' SEND_COMMAND dvTP,"'^TXT-1,0,please standby. system coming online...'" } CASE 2: //2 Seconds { CALL 'DISPLAYS_ON' SELECT { ACTIVE(nSelection = 1): // TS VTC { OFF[dvREL,3] // Kills SECRET Power (Should already be off. This is a second back up.) TIMED_WAIT_UNTIL(!nSECRET_POWER)100 // Wait until IO 3 is OFF { OFF[dvREL,1] // Camera and MIC A/B Switch. Both OFF = TS OFF[dvREL,2] TIMED_WAIT_UNTIL(!nIOTEST)100 // IO 1 and IO 2 are both OFF { ON[dvREL,4] // Apply POWER to TS codec WAIT_UNTIL([vdvTS_CODEC,252]) // Module is initialized { CALL 'TS_VTC_CONFIG' SEND_COMMAND dvTP,'@PPA-' SEND_COMMAND dvTP,'PAGE-TS VTC' SEND_COMMAND dvTP,'@PPN-camera_controls_vtc' DO_PUSH(dv_TS_VTC_TP,4) } } } } ACTIVE(nSelection = 3): // SECRET VTC { OFF[dvREL,4] // Kills TS Power (Should already be off. This is a second back up.) TIMED_WAIT_UNTIL(!nTS_POWER)100 { ON[dvREL,1] // Camera and MIC A/B Switch. Both ON = SECRET ON[dvREL,2] TIMED_WAIT_UNTIL(nIOTEST)100 // IO 1 and IO 2 are both ON { ON[dvREL,3] // Apply POWER to SECRET codec WAIT_UNTIL([vdvSECRET_CODEC,252]) { SEND_COMMAND dvTP,'@PPA-' SEND_COMMAND dvTP,'PAGE-SECRET VTC' } } } } } } CASE 3: //4 Seconds { //SEND_STRING dvDoc_Cam, "$81,$01,$04,$00,$02,$FF" // Doc Cam Power On //CLEAR_BUFFER cCam_Buff //WAIT_UNTIL(FIND_STRING(cCam_Buff,"$51",1)) //{ //SEND_STRING dvDoc_Cam, "$81,$01,$06,$02,$0A,$0A,$00,$00,$00,$00,$0F,$0B,$05,$01,$FF" //} } CASE 4: //6 Seconds { } } }
Upon initial testing on my desk, it seems to work like it is supposed to. I was hoping for another set of eyes to look it over to see if I overlooked any "what if" type situations. I also wanted to know if there was a more correct way to do this instead of a bunch of WAIT_UNTIL's. Thanks.
0
Comments
looks good,
I have had to do this same thing for about 15 different rooms for one of my customers. I would use a timeline as well. Some notes for you:
1. Codec takes about 15 to 20 seconds to fully boot up.
2. If you are using a Java module takes up 30 seconds to initialize.
3. Code send an initialize string on boot up you can tract for when its on