Author Topic: Beginners Help  (Read 9086 times)

Offline LBee11

  • PLUS+1 Developer
  • ***
  • Posts: 26
  • Karma: +1/-0
Beginners Help
« on: February 08, 2017, 09:16:07 AM »
Hi All,
I'm new to PLUS+1 and am hitting a few stumbling blocks. I come from a ladder logic PLC background (Rockwell mainly) and have now found myself looking at PLUS+1 software.

I'm trying to fill an Array, where I fill the last element first if it's zero and work my way back. Basically the new value goes in anywhere there is a zero along the Array.

I understand the logic of how to do this, but I can't work out how to only do a "Set Array Element" when a boolean value is true. Ladder is easy in this respect, simply put your boolean value in front of the array command.

See the attachment to see what I mean.

I'm hoping this is a simple oversight of mine as I get my head around this!

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 363
  • Karma: +33/-0
Re: Beginners Help
« Reply #1 on: February 08, 2017, 05:53:17 PM »
You may want to look up the 'Value Connect' component in the manual.  That might fit your need.
Controls Engineer
Hydra-Power Systems

Offline Nilla

  • PLUS+1 Guru
  • *****
  • Posts: 253
  • Karma: +14/-0
Re: Beginners Help
« Reply #2 on: February 10, 2017, 02:17:23 PM »
Hi Alvxx1!

In the PLUS+1 GUIDE v9.0 User Manual (UM, found under Help in the menu bar) on page 318 you will find the following about the Set Array Element:
  • X1 = A2 if A1 (the set position) is positively or negatively out-of-bounds
This means that if the A1 entry is (for example) -1, then the output array will have the same value as the input array.

So, In your case, simply set this input to -1 when the Boolean value is false. (This is also shown in the first image under “Example2” on the same page in the manual.)

Alternatively, since you are familiar with Ladder Logic, you can simply use that instead in PLUS+1 GUIDE. PLUS+1 GUIDE is supporting Structured Text since version 6.0, and Ladder Logic + Function Block Diagram since version 8.0. See chapter “IEC61131-3 PLC Languages” on page 525 in the same manual as above for more information on this subject.

One tip, when you have the component you would like to use highlighted in the component tab on your right in GUIDE, hit F1 and a dialog box will open for PLUS+1 GUIDE help where you can find some more info without having to open the UM. 

Hope this helps!

Best regards
Nilla
PLUS+1 Helpdesk

Offline LBee11

  • PLUS+1 Developer
  • ***
  • Posts: 26
  • Karma: +1/-0
Re: Beginners Help
« Reply #3 on: February 13, 2017, 12:03:52 PM »
Thanks Nilla,

I've simply managed all of my Arrays in Structured Text instead, much easier! :)