From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Events with NI 9403 on cRIO

Hi,

 

I have a cRIO with a bunch of light switches connected to a NI 9403. Previously I polled the states of the inputs to determine if a light should go on or off. To reduce overhead and speed up the process, I would like an input on the 9403 to trigger an event structure.

Is it possible to do this? How do I get the event structure to recognise the 9403? Is it a recommended approach to use events on a cRIO?

 

thanks,

 

J

0 Kudos
Message 1 of 4
(5,636 Views)

Hello J,

 

Can you give some more information about the "timing part" of this application?

Or in other words: How fast should this change be detected?

 

Are you working in LabVIEW FPGA or in LabVIEW Real-Time to access the 9403?

I suspect you're working in LV Real-Time.

 

Do you have the code available for your current application?

 

Thanks in advance!

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 2 of 4
(5,619 Views)

Hi, thanks for your reply.

 

I am using Labview Real-Time, I have the NI 9403 plugged in a cRIO 9075.

 

Change shouldn't be detected quickly, as we are using manual switches.

I have a dummed-down version of the code attached, to show you where the bottleneck is. It has only 2 buttons, in real life our application has 24, but it should be scalable to even more.

 

The subVI in the case diagram sends a single command to an external LED-light control card via ethernet. It takes 3 variables (in the cluster): channel (which light in the house), current and PWM value. The PWM value allows us to dim the lights.

Now it's the dimming where it gets tricky: while ON/OFF is just one command (PWM 0 or 50000), dimming requires visual feedback to the user so we need to continuously send new commands to the control card, while we increment or decrement the PWM value.

 

When dimming (the subVI before the case diagram determines if we want to dim, i.e. when the button is held down for longer than 1 second), I increment the PWM, send the command, and the while loop starts over. However, we also need to keep polling the inputs of all the buttons, for somebody in the house might want to turn on his light while somebody else is dimming.

This causes an undisired effect: in bigger houses, with more buttons, the polling takes longer, and hence the dimming slows down.

 

I thought it would be a good idea to solve this problem with a event structure that is triggered when a button is pressed, but I can't seem to figure that out with the 9403 in Labview RT. Last week I talked to an NI-engineer who told me events would be a good idea, because it reduces overhead on the system.

 

thanks,

 

J

 

0 Kudos
Message 3 of 4
(5,611 Views)

Hello JrtPec,

 

Can you also upload your project you're using?

This makes it easier for me to do adaptions without breaking any parts of your project architecture.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 4 of 4
(5,606 Views)