LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stop button to reinitialize c-RIO module values

prog.jpg

As you can see, the program has 2 stop buttons.  The one inside the tab is to stop charging of an electric vehicle prototype whereas the one outside is for stopping the while loop and labview program. Both stop buttons are wired to the same conditions except the additional function of the 2nd stop button for passing notification i.e.:

stop.jpg

The labview program is connected to the EV hardware through c-RIO system via ethernet, which uses NI 9411 for updating the charging status of the EV prototype. The issue is: while the 1st stop button causes the counter value of NI 9411 to fall thus updating the charging status of EV, the 2nd one just stops the program and goes back to the first page and the status remains the same (even though this can be modified for display in the labview program, it cannot be changed in the hardware). What do i need to do to update EV status before stop button makes the program exit and goes back to the start page of the program?

0 Kudos
Message 1 of 6
(2,545 Views)

Hi shreya,

 

using two "STOP" buttons is really bad program/UI design…

 

What do i need to do to update EV status before stop button makes the program exit and goes back to the start page of the program?

You need to update your status programmatically!

You need to program all things your requirements dictate!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,534 Views)

Hi but the two stop buttons are necessary for this application as the internal stop button is present on this page of the the tab. If the user wants to stop the program earlier, he has to do so using the external stop button [the abort button in the toolbar is made invisible to avoid confusion]. As seen in ControlEV.vi, the CTR0 value must drop to a value below 100 (value is usually 49.25 when internal stop button is pressed) and it has to go through a series of steps: Unlock >> init >> relays before the program stops and returns to the welcome page. this would cause the charger plug to be unlocked from the EV plug point and EV plug point would change from blinking red to green/ blue.

0 Kudos
Message 3 of 6
(2,527 Views)

Hi shreya,

 

apart from your bogus (IMHO) program design: it's YOUR JOB to follow all requirements and to provide a graceful EXIT routine!

 

You need to program it! Create a nice state machine and call an EXIT state, when the user exits the main routine…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,524 Views)

Hi!

 

I read your question (and GerdW's answers) to be a request for a piece of code to fix your problems. I think what you really need is to take the time to have a look at some design patterns for code, and figure out how it can be used to solve your particular problems. Use the LabVIEW Example Finder (Help -> Example FInder) to look for examples that come with LabVIEW! My suggestions:

 

Event Structures: This is a structure specifically designed to catch user driven events, such as clicking a button, and executing a certain piece of code in accordance with the input. Example: Clicking the "stop button" might start some code that gracefully shuts down your program. 

 

State Machines: A state machine is a structure usually built using a while loop and a case structure containing pieces of code that perform specific tasks (e.g. "initialize", "check conditions", "idle", "charge" and so on). Each state/case determines in some way what should be the next state to execute. Passing states to the next iteration can be done with queues or shift registers.

 

Good Luck!

Best regards,

Jarle Ekanger, MSc, PhD, CLD
Flow Design Bureau AS

- "The resistance of wires in LabVIEW is not dependent on their length."
0 Kudos
Message 5 of 6
(2,512 Views)

@

0 Kudos
Message 6 of 6
(2,502 Views)