06-29-2022 06:17 PM
Hello there ; I'm looking for tool or function in labview that do this : when I press the switch on there is numeric constant number intrance to holding register and when I release the on off switch there is the numeric is off too
Best regards
Mohkoi
Solved! Go to Solution.
06-29-2022 09:14 PM
Sounds like an Event Structure to me. Is this a Front Panel control (one that responds to the User pressing a Control On or Off)? That's precisely what Event Structures do. If, on the other hand, you want to know when a variable changes from On to Off, or Off to On, this can be accomplished by a While Loop inside of which is a Case Statement. You put the Control inside the While Loop but outside the Case Statement. Wire the output of the Control through the Case Statement and terminate it on the far wall of the While loop in a Shift Register. [I assume you know about Shift Registers].
Now go back to the input side of the Case Statement. The Shift Register (on the left) holds the value of the Control in the previous iteration. Is the new Control the same or different from the old? If the same, it hasn't changed, so you can wire that Case to "Do Nothing" (maybe wait a tenth of a second so as to let other code run). If it is different, then you want to look at the Control and do whatever is appropriate depending on the (new) value of the Control.
I'm giving you a lot of words, rather than a Block Diagram or LabVIEW code you can simply copy, because I'm wearing my "Professor" Hat. I'm hoping you'll try to understand what I'm saying, will try to create the diagram(s) I mention, and "see for yourself" how this works, and in the process, Learn LabVIEW.
Bob Schor
06-29-2022 10:43 PM
Holding register is a Modbus thing.
There is a free LabVIEW Modbus API
07-02-2022 11:05 AM
hello ;
thanks for your replying now i found from comparison in pallet is (select tool) that exact what i need so if i press on then the select tool choose number that i entered to select tool .
best regards