LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create ladder diagrams in Labview

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...

0 Kudos
Message 11 of 14
(1,286 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 14
(1,262 Views)

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

0 Kudos
Message 13 of 14
(1,253 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 14
(1,242 Views)