03-26-2016 12:12 PM
Hello Guys,
Can anyone tell me how to create the labview code for this ladder logic,
there are two timers 1st goes for 5 sec and the 2nd goes for 10 sec.
below is the .png...
03-26-2016 12:47 PM
Hi chintamani,
- you have 3 parallel "ladders", so you have to have 3 code parts running in parallel: don't have data dependencies between those code parts (THINK DATAFLOW)!
- TON functions can be programmed in LabVIEW using ElapsedTime function and a simple comparison afterwards…
03-26-2016 01:04 PM
Gerd,
I only messed with Ladder Logic once (I really hated it -- should have convinced people here to invest in an NI Motion Controller ...), but don't the rungs of the ladder "fire" in sequential order?
The model I think of is a While Loop running as fast as it can, with the Inputs and Outputs available at every step of the Loop. I just tried simulating the TON function using the Elapsed Time Express VI -- it is certainly easily done, though I'm uncertain what the (Ladder or "real") Logic would be to reset this, or if the User wants this to be "one-time" code ...
I'm firmly down on the side of replacing Ladder Logic, which is difficult to read, difficult to organize, I assume difficult to implement (in hardware) for LabVIEW.
Bob Schor
03-26-2016 01:10 PM - edited 03-26-2016 01:14 PM
HI Bob,
I'm on your side - I used StructuredText together with graphical programming to create a PLC program. Ladder logic was also quite cumbersome…
So maybe I'm wrong with the "parallel" part.
- Infact the "bit" is used in the lower two "lanes" - I would use the result of the first lane then. Lane 2&3 should execute after lane 1.
- "Bit" is also used for "holding" the state in lane 1, so a shift register should be used to store the "bit" state.
- It all boils down to some simple boolean logic and two TON functions (aka two ElapsedTime functions and two comparisons), contained in a loop with a shift register…
I'm firmly down on the side of replacing Ladder Logic,
That's what chintamani asked for…