biged
Hey guys, wondering if someone could help me. Ive spent way too much time on this and i think its an easy fix. Im a PLC newb. I need this program to run a fairly simple hydraulic press.
 
Ive got the program complete and it debugs ok and seems to do what i want. It uploads to the to the leonardo fine, but it doesnt seem to work when i have it all wired in. Not sure if my pins are mapped wrong or if i have made my ladder logic slightly wrong.
 
-Im feeding 5v power to pins VIN and ground
 
-Ive got 7 digital inputs (plc pins 2,3,4,5,6,7,8) and location in open plc as ( %IX0.0--to--%IX0.6)
 
-Ive got 5 digital outputs ( plc pins 9,10,11,12,13) and location in open plc as ( %QX0.0--to--%QX0.4)
 
-The inputs 12v send power to the signal amplifier board. changing the npn switch 12v to 5v out to the arduino , only 1 input is a NC switch (esd. #1)
 
-The outputs will send 5v to a relay module to close a NO relay to send power to some solonoids or an alarm
 
Im hoping its an easy fix if anyone can help me out its much appreciated.
thanks for any help
Reply 0 0
thiagoralves
I guess you could check a couple things:
  1. Is the program really uploading to the board? What does your output window say?
  2. What does your I/O Config screen look like (on the upload dialog)? Does it match your expected configuration?
  3. Can you debug the application running in your board (blue bug icon on the toolbar)?
Reply 0 0
biged
I guess you could check a couple things:
  1. Is the program really uploading to the board? What does your output window say?
  2. What does your I/O Config screen look like (on the upload dialog)? Does it match your expected configuration?
  3. Can you debug the application running in your board (blue bug icon on the toolbar)?
Hey
 
looks like i figured it out. Once i got the debug working it was easy to see my mistake.
( i couldnt get it to work before, had the wrong slave id #.) Its easy when the debugs working. I spent way to much time messing around with open plc runtime/ modbus.
 
 
I just needed to swap my coils and contacts to negate instead of normal and i got the results i was after.
 
 
thanks
 
 
Reply 0 0
thiagoralves
Glad to know you’ve figured it out. The debugger is indeed very useful. As a friendly tip, I would advise you to avoid crossing lines in your ladder diagram (spaghetti code). Keep things as straight as possible. It helps you read the code better later.
Reply 0 0
fg71
Good approach is to build the program with more rung or blocks instead of trying to build the logic with less. It would be easier to debug input <-> output. And example would be why use 2 NO and 2 NC to make XOR when we could use 1 block. I'm not saying that is the case in your code.
 
Your first rung set the coil and you use that state to set your function that you have in parallel in your first rung. In other words that function become your second rung.... and so on.
Reply 0 0
Reply