MartyB

MrPLC Member
  • Content count

    12
  • Joined

  • Last visited

Everything posted by MartyB

  1. Counting Sensor

    Interesting. It seems that I had everything in order before and just wasn't able to simulate successfully. Below I'm attaching another example I just cooked up from the IO_Rack example
  2. Thank you for the advice. I just had to convert the data type to DINT and then convert back. Couldn't change variable data type from the get go since I'm receiving and sending them through the network and the receiving device specifies all data has to be in DWORD. 
  3. I'm working on simple structured text program which takes in DWORD values, does some math on them and then outputs in DWORD type. What data type should I be using and how can I make this work?  This is one of the lines from the code(everything DWORD) and I get 'operator not supported by DWORD data type' XPos3 := XPos1 + (2*XIncrement);  
  4. Counting Sensor

    I couldn't get the counter to work in simulation (step one) so I just did it using increment/decrement instructions below it, hopefully that will help you move along. Maybe someone will have a working counter program and is going to be able to share it. Increment Decrementprg.cxp
  5. Capture snapshot of I/O data for simulation

    Double click on 'memory' -> double click 'cio' -> Click on Binary and then monitor This way you can see all your physical inputs and outputs
  6. My code is just of the basics to serve as a tutorial for anyone looking into pointers/indirect addressing in the future. After being able to follow your program I was able to use it for the solution to my own problem
  7. Hello, CJ2M CPU-32 to IAI motion controller through ethernet/ip I'm working on programming electric actuators to pick up parts from a tray. I will have x (row) and y (column) coordinates that I need to update to move the actuators. So to go through the whole tray I would have to use nested loops. (below what i'm trying to achieve if i was doing it in C++)                                           6 Rows and 6 Columns, palettizing                                           data rows&columns DWORD (Row1,row2,row3...row6; col1,col2...col6)                                           c++ code                                           for i=0,i++,i<6;                                               rowData = row                                               for i=0,i++,i<6;                                                   colData = col                                                   execute movement                                                   wait for confirmation                                               end                                           end I have a way of doing it but it will require a lot of repetitive lines and typing every step, and I was wondering if there is a way on every iteration to increment the data location instead of the contents. In the picture below you can see the example where the goal is to copy data from D8100 to D8000, then in next step from D8102 to D8000, then from D8104 to D8000 and so on. So far in the documentation I was only able to find how to increment contents. Is it even possible to do what I want to?
  8. Unable to conect to PLC

    -Do you have another plc you could test connecting to? -go to device manager and see if com port is showing anything connected. -if you do have another plc then you can test if the issue is on plc side or laptop side. -If you don't have another plc then test the USB port on laptop (insert usb drive, see if opens/shows), I assume your cable is USB type A to USB type B which you can test on anything that uses one (printers usually do). Or look up cable pinout and use multimeter.
  9. Thank you @lostcontrol. to be honest your example initially flew over my head but at least I knew that I needed to look into "pointers/ indirect addressing". Files in the  http://forums.mrplc.com/index.php?/topic/32363-ask-how-to-indirect-addres-plc-omron/  helped tremendously. And then I was able to follow your example. I'm attaching a program I came up with (tried to simplify as much as possible) and a picture with some screen grabs of the simulation. I think it will serve as a good starting point to the next person trying to learn it.    Pointers.cxp Pointers.cxp
  10. Unable to conect to PLC

    Another thing to check would be in cx-programmer go to PLC>Change Communication Settings>and change to whatever communication method you are using We had it before where the plc program was set on ethernetIP and one on computer was USB, and it didn't want to connect
  11. So the solution suggested was to build function blocks, since you can use structured text inside them and achieve those nested loops. Or if there are not that many steps then just write out the whole sequence.  Another interesting function I found was "Address incremental copy" which can copy and paste a repeating block of ladder logic but increment the bits by whatever amount is needed.
  12. Thanks for the suggestion. He's actually the guy who we buy all Omron stuff from.