What's the correct syntax to test the IOs on startup?
sijandi
Posts: 8
We have a client with an NI-3100 and are using an IO to indicate the status of his back up power generator. When the generator is running it closes a contact and we display feedback on his touch panels. I programmed a BUTTON_EVENT to execute this (on a Push event) and everything works fine as long as the processor has power when the contact closes, but if the contact is already closed when the processor reboots then we don't get the feedback. The LED on the processor associated with this IO is illuminated though.
I was going to create a DATA_EVENT for when the IO comes Online, but the compiler didn't like my code so I think I'm missing something obvious. Any suggestions would be appreciated.
shane
I was going to create a DATA_EVENT for when the IO comes Online, but the compiler didn't like my code so I think I'm missing something obvious. Any suggestions would be appreciated.
shane
0
Comments
Remove the ON and OFF statements like the example below.
This event will get triggered anytime the state of the IO changes, and will properly update on reboots.
I understand what you are saying, but it does not invalid the point I was trying to make. At one point in Device Firmware, not sure if this is still the case, the IO indicator LED would be lit but the IO device would report the IO as being OFF, if the IO was ON during the reboot. This is why I recommend sending the "device status 5001:17:0" command via telnet, it will tell you if the LED and what the IO is reporting are out of sync. If they are out of sync, actively asking the port state will still return the wrong value.
I am not sure if this is the issue that [highlight]sijandi[/highlight] is encountering, but it is worth mentioning.
The last changed listed for device firmware 1.20.7 is:
Fixed states of IO ports after a reboot.
I have a site with 25 rooms that exhibited this behavior on 1.20.7.
With an NI700 using firmware V3.60.453 (old, low memory NI700) and device firmware V1.30.10. if an io port is set as "LOW" and it is closed when the master is booted, both a channel event 'ON' and a button event 'PUSH' occur when the IO device comes on line. The channel "ON" occurs before the button "push".
So, what I see is that either method should work -- either a button event or a channel event. In my experience with real live systems, either method does work and has caused no problems. That may just be lucky firmware selection. That is, it may just be that on the systems we used IO ports we didn't have any of the problem firmware installed.
If the only thing being done is tracking the status of the device so that feedback can be sent to a touch panel, this can be done with one line in define_program such as:
[dvTP,FeedBackButtonNumber] = [dvIO,ChannelNumberToBeMonitored]
I have a magnetic sensor wired between my garage door and I/O port 1. When the garage door is closed the I/O port is ON and lit. Whenever CHANNEL_EVENT [dvIO,nGarageDoorInput] triggers an ON or an OFF there is a voice announcement made in the house.
The garage door is closed 99% of the time. I’ve been making several changes to the software recently (I got tired of driving away and always asking my wife, *Did I remember to close the garage door?* or *Did you see the garage door go down?* so now the system also sends me a text and an email whenever the garage door changes state) and after every reboot I always get a voice announcement, a text, and email stating that the garage door is closed. Best I can tell it never misses.
It’s not to say the problem didn’t exist (the firmware change listed implies it must have) but I’ve never seen a problem with my configuration or other jobs I’ve worked on. I guess I’ve been lucky as well…