Author Topic: Input[1] to Input[5] Operation  (Read 20654 times)

uknanoman

  • Newbie
  • *
  • Posts: 19
    • View Profile
Input[1] to Input[5] Operation
« on: January 06, 2023, 07:57:41 AM »
Hi Support.
                In my application I am getting data from a remote i/o block via modbus and placing it into a register say dm[10].
I then used Input[2] = DM[10] to place the remote input data into the wx100 plc inputs area starting at input 17. However I have found that this area keeps clearing the data back to zero. I am using a WX TERM 8 with my WX100 so this only uses 8 inputs so I assumed that I should avoid at least the 1st 16 inputs and place the data in Input[2] area. I then used the i/o monitor to force various inputs on /off and noticed that I could only correctly set / reset inputs starting at input 81 which relates to input[6] which seems to indicate that you have reserved the first 80 inputs for remote tri-plc input useage?. Anyway its not a massive problem as I can simply place my input data by using input[6] = dm[10].
the only problem with this is that I cannot monitor on the screen, inputs 1 - 8 at the same time as monitoring inputs 81 onwards. So I was wondering if there is a system switch somewhere that can be set according to the number of input points used. In this way I can bunch my inputs on the monitor screen and see them all at the same time.
Regards Peter     

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Re: Input[1] to Input[5] Operation
« Reply #1 on: January 06, 2023, 01:25:10 PM »
Your attempt to use INPUTs as general purpose data storage has a small problem. When the PLC ladder logic is running it will overwrite all of the INPUT values during each scan of ladder logic. You are using INPUTs that your PLC does not physically have but the ladder logic code does not know how many INPUTs your PLC actually has (or are actually being used) so it scans  the maximum number of INPUTs that ladder logic can handle.  This number is way more that 16. This is why your are seeing your "special" INPUTs getting cleared to 0.

I suggest that you store data in either DM[] or RELAYs. If you store your DATA in RELAYs you can make it visible on the first page of the simulator / on-line monitor.

If you insist on using INPUTs for data storage you may need to use the SetSystem 16,n statement on the the first scan of your PLC program. The SetSystem 16,n sets the number of I/O pins that will be accessed.  The "n" argument affects the number of I/Os to access. When n=1 the I/0 pins 1-16 will be scanned. When n=2 then pins 1-32 will be scanned.

SetSystem 16,n is intended to help speedup the execution of ladder logic by restricting the number of I/Os that must be processed on each pass thru the ladder logic.

I use SetSystem 16,n for it's intended purpose to speed up the ladder logic execution. It works for this purpose You will need to test and verify if SetSystem 16,1 will solve the problem that you have created. 

Gary Dickinson
« Last Edit: January 06, 2023, 04:42:13 PM by garysdickinson »

uknanoman

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Input[1] to Input[5] Operation
« Reply #2 on: January 06, 2023, 07:00:29 PM »
Hi Gary
          Thanks for this response. On the face of what you are explaining it would appear that the wx100 must default to set system 16,5 because inputs 81 onwards seem to retain a forced state via the monitor I/o control or as I have found out by using input[6]=dm[10]. In these cases it seems not to be overwritten with a 0. So with your suggestion in mind I will try a set system 16,1 and see how it responds when I get back to work next week. You may be wondering at my thought process regarding storing of (data) at input points. It is simply that because the (data) is data related to physical inputs from a remote i/o block via modbus, I prefer to map them into into an input area of the plc for the clarity of inputs being inputs and subsequently being prefixed with an (i) eg i81 when looking at a ladder diagram. As you have rightly perceived data is after all data whether it is I/O or other my problem is that I can get a bit picky sometimes about how I want that data to appear in the context of the program. Thanks for your input into this post much appreciated, I will let you know how I get on.
Regards Peter

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Input[1] to Input[5] Operation
« Reply #3 on: January 08, 2023, 08:36:30 PM »
Gary suggestions works on the Fx and FMD PLC but unfortunately this won't work on the Wx100 since it uses a different expansion I/O handling system.

Upon power on the Wx100 scans the attached expansion I/O space and mark those expansion I/Os that are available and will only scan those boards during I/O scan. So if a board is not detected upon power on it is not scanned and thus save the I/O scan time automatically.

However, the current Wx100 firm reserves the first 80 digital inputs space and will keep those non available inputs at zero (OFF). It doesn't allow these to be used by the user program. This may change in future firmware revision if there are more users who request such a feature.

 
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

uknanoman

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Input[1] to Input[5] Operation
« Reply #4 on: January 10, 2023, 01:31:55 AM »
Hi
   Thank you support and Gary for looking into this for me. Just before I got this reply I had tried the setsystem 16,1  and yes it made no difference. So as it stands I will keep the remote input data at inputs 81 onwards which seems to work fine.
Regards Peter