innoaloe

MrPLC Member
  • Content count

    425
  • Joined

  • Last visited

Everything posted by innoaloe

  1. How can I simulate CP1L-E & NB HMI?

    Technically it's possible. The NB can be simulated in Direct Online Test mode when the PC/laptop is connected directly to a serial port of that PC/laptop (you cannot do this with Ethernet PLC connection) The NB will send FINS or HostLink Command (depending on what PLC type we choose) to the serial port. FINS or HostLink Commands definition are available on Omron W432 manual. This means you also need to emulate the FINS or HostLink reply in the PC, by either using a custom made program or other manner possible. Worth it? I think not :D
  2. I never used it, but referring to the manual (screenshot here...) you can see that the TimeWidth and ReachSP values might change depending on the parameter you've input and the Step Number. I think this is to prevent any unintentional behavior due to improper parameter settings.
  3. Indirect addressing in FB CJ2

    For FB typically we use the IR and DR register for indirect addressing. Although compared to the Decimal-based reference above (The @ tag) it's more complicated to use. But pretty reliable I'd say
  4. If you already creating a UNION Type which contains the same datatype as your required I/O Map, you can use that Type for I/O Map directly. For your case, just create 85 Union Global Variables for outputs, and 45 Union Global Variables for inputs. Map those to your Pneumatic Island I/O Map. That way you don't need to use the MOVE instruction anymore.
  5. CP1H + CIF12 custom protocol

      As Berti Baker mentioned, CP1H is programmable only with CX-Programmer. About the text editor, CP1H do supports that, but only for Function Block creation. You cannot use it in the main program itself. You can create the sequence all in text editor, but still need to call the Function Block generated by it in a Ladder program. In my opinion, you just make the program flow in the normal ladder way, but for sending/receiving and protocol editing, you can create a custom Function Block with the text editor for easier measures. Only CJ-series PLC supports full text editor programming in CX-Programmer.
  6. Funny, because it did worked for me. I attached an example here. This is the way I did the conversion. You can see from the Watch Table that each characters are converted to it's proper Hex ASCII Code
  7. In Omron CX-Programmer, CIO addresses are referred by numbers, so if you put numbers like 0 to 2560, it will mean you're accessing CIO 0 ~ 2560 address contents. In your screenshot, your SV is set to 4 which means your SV is the value inside CIO 4 address, which typically will be defaulted to zero during simulation. As CNTR is a BCD counter, you should put # mark next to the number you desired for SV to put it as a BCD constant. Example for SV of 4, you put #4 in the SV. This rule applies for any direct number input operations like BCD Addition / Subtraction. For binary numbers (lets say you use CNTRX instruction, which is a  binary counter) you should put & mark next to the number you desired. Example for SV of 4, you put &4 in the SV. That's just the rules defined by CX-Programmer.
  8. If you can print already then it means you already understand how the SktTCPSend works. It sends data stored in Array of Bytes. Typically you will create a STRING variable first which contains the text, like 12345 for example, then you use StringToAry function I believe to convert the said STRING into Array of Bytes. To add <ESC> you can do it 2 ways : 1. Put a $1B in your String, e.g. you want to print 12345<ESC>, then you fill your string with '12345$1B' . The $ operator is a String character code detector. On some cases though it cannot detect what code is inputted (depending on what code being used). 2. Set the last byte in your array to 16#1B. Let's say printing 12345, then you will have a byte array of (16#31, 16#32, 16#33, 16#34, 16#35). You just need to move the value 16#1B into the next array index
  9. OMRON CJ2M-CPU11

    ModbusTCP with NB HMI uses the []X addressing, example 4X Addresses is to read Holding Register values. Which Holding Register you should read again? You must look onto the MFM Communication Manual. NB can only help you to read and view it, but it wouldn't know which register it should read if you don't specify it. Since your MFM have ModbusTCP Server built-in, you shouldn't need any PLC for this communication.  
  10. I just found out from this article HERE that TeamViewer did have a VPN utility inside (already checked with my TeamViewer program also). Follow that article to set it up
  11. I have two guesses : 1. You don't have any battery installed on your PLCs 2. You didn't transfer your IO Table setting to your PLC I don't know what you mean by clicking "Set" and "Regist". Didn't see any of that in the IO Table window. Typically there will be "Transfer PC to Unit" button to save your changes into PLC. Make sure when transferring program you also check the IO Table and Special IO Unit Parameters checkbox, or else the IP Address settings will not be transferred. The 192.168.250.XXX is a default addressing system used by Omron only if the ETN unit parameters is not set manually. The XXX will depend on your Rotary Switch settings (in your case it is 31) Let's say you've downloaded the settings, in the case if your PLC didn't have any battery, after power cycle the content of D Memory Area which holds the IP Address value might be cleared so the settings will revert back to default.
  12. Puls train.

    Indeed only CJ1M-CPU2[] series supports PULS instructions since they incorporated a Pulse Output module. However for low-frequency application like this, you can resort to the TPO instruction. TPO is basically a PWM generator with modifiable period and duty cycle.
  13. edit time variable in Recipe NA HMI

    Look for NanoSecondToTime, or MillisecondsToTime instruction in NJ. You put LINT valeus of Timespan in Nanoseconds / Milliseconds in HMI then convert it to time by program. If your time requires Hour, Minutes, Seconds, you can put each individually then calculate the total value in Nanosecs / Millisecs before converting to Time.   Alternatively you can implement a Custom Time Keypad in NA to input Time values directly to Time variables, although it's more complicated (requires VB Scripting)
  14. HP Printers typically uses PCL on a TCP Server Port 9100. You need to know / set the IP Address of your printer to match NJ's subnet. (e.g. NJ is 192.168.250.1, printer is 192.168.250.10, both same subnet mask of 255.255.255.0) Then you need to use SktTCPConnect function block on NJ to the open connection to printers port 9100. After connection has been made, you can send PCL commands using SktTCPSend. Send it as an array of ASCII BYTEs typically.   However I'm not sure whether TCP Port 9100 is used on your printer or not. Sometimes HP also uses UDP, so it'll depends on your printer model and specs.
  15. Sysmac Studio : MEROBEL DGT300+

    You are correct. Typically any equipment equipped with ModbusTCP are ModbusTCP Server running on Port 502. So you need to set your NJ as a Client. Use the ModbusTCPClient FB for your NJ to connect to the DGT. Should connection is established, then you run the Fn03/05/04/10 Function Blocks to Read/Write data. As long as you connect the device continuously, you don't need to Close the connection.
  16. Sysmac Studio : MEROBEL DGT300+

    Go to the following Link and Download the MTCP_NJ file https://www.myomron.com/index.php?action=kb&article=1245 Import the SLR file inside it to Sysmac Studio Library (Project --> Library --> Show References), then you'll find the MTCP_NJ Function Blocks on the Toolbox. These function block were developed by Omron France team. It even had manual in French inside the ZIP so it should be easy to follow for you. Basically from the brochure, I only know DGT300+ ethernet port is using ModbusTCP. You need to look for their communication manual to see what parameters you need to set in the DGT, and what are the Modbus addresses you need to read / write using the Modbus Functions...  
  17. This is a design choice that Omron made. Most Execute In-Param only detects Off to On transition (Rising-Edge). This is done to avoid multiple-triggering of an FB with intermittent action that is currently in process (Busy Out-Param On, Done Out-Param still Off) on the next program scan cycle. This is not the case however for FBs with continuous Action such as Jogging a servo motor. You might already know this, but every Function Block provided from Omron is equipped with a help file (press F1 when selecting the FB) that also provides timing diagram. You can refer to those to check how to trigger it in a program.
  18. This is a good catch, however it is true only if we're using NJ as a TCPClient, which is using SktTCPConnect Function Block. In OP case he is using NJ as TCPServer, so that rule doesn't count.
  19. I'm not sure... seeing no ErrorID or Error flag popping out, it means your instruction was run OK. Also the Done flag should only lit-up if the connection is established with a client. Do you close the socket in NJ after read/write activity using the SktClose or not? Because if plugging out ethernet cable made the re-enables the SktTCPAccept, that's because the port was closed automatically by the hardware design. But if you tried to open using SktTCPAccept twice on a same socket handler (your socketNum) without properly closing the port first, it'll get stuck. I might be wrong about it, but I believe when a client closed a socket connection, it closes it's own local port and not the servers port. That means the server also need to properly close it's port first before attempting to receive another session, isn't it?
  20. APR AND SCL instruction problem

    Unfortunately cpu with 20 I/O version cannot have any expansion unit installed on it. You need to have at least 30 IO version And MAD01 is CPM2 expansion unit I believe. Not for CP1E series
  21. Well 30 years is 10 times my work life these far :D... Cheers to you I've been doing TCP related stuffs with Omron PLC and I must say Closing a Socket is one of their weakness. Old models like CP1L-EM requires us to wait like 2 minutes before we can re-open a same socket. Why that happens I don't know... should be some hardware design issues. However the same cannot be said for NJ I'd say. In my experience it does the job properly. As stated by by SktTCPAccept manual, a same Local Port number can be used for different instance of Sockets. What needs to be make sure of is that the Socket Handle is really closed. I'd say you can try to crosscheck the current status of the Socket Handle using the following FB and enumerators : And just a though, but AFAIK for a TCP Server, we don't really need to close the socket should only a single Client IP is connecting right?
  22. Well... this instruction is used along with a TCP Socket object (you need to have either SktTCPConnect or SktTCPAccept first which outputs a Socket) There isn't much to do with the SktSetOption FB. You only had one possible enumerator for OptionType which is _eSKT_OPTION_TYPE#_TCP_NODELAY Then the OptionParam need to be a BOOL variable whose value is either TRUE / FALSE.   I'm not sure what is the NoDelay function is used for. All I can think of is that Send/Receive action needs to be done instantly if the Param is set to true
  23. Debugging ST programs in NJ5xx?

    Ever since the CX-Programmer I don't think such feature exist in Omron. Could you name a PLC which supports single-step execution on the controller? Don't mention beckhoff ofc since they're IPC based.
  24. The instruction does exist and the details also provided, but :   So now the question is, what controller are you using, what version, and what version of Sysmac Studio are you using
  25. Debugging ST programs in NJ5xx?

    IIRC even with ladder you cannot set breakpoints / single-step execution if you are connecting to a real controller. With ladder logic we typically assign a Coil-Contact combination as the "Step" control With ST programming I often use CASE OF statement as the "Step" control With ST you still can Watch/Modify variable