Jump to content


UniStream & UniLogic Beta
  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by linxchas

  1. Here is 2 years old topic were i posted sample code-NMEA-350 (link from my dropbox, If the file that you downloaded has an extension .zip, just replace it to .vlp. Than you'll be able to open it in Visilogic). http://forum.unitronics.com/index.php?/topic/1504-use-pointing-to-filter-data-from-rs-232-input/?hl=gps#entry5068 Hope it will help.
  2. You have 3 ways to get the remote access to PLC thru internet: The easiest is remote access to the computer in same network as PLC - for example TeamViewer. Just install Visilogic on this machine and you are ready to go. Port Forwarding in the router which belongs to the remote network. Here you'll need IT assistance. Listen mode. (see topic 7780). The most complex, but the best way in case of enterprise application, when you'll need maintain connections to many PLC's (2500 in my case).
  3. Here is tiny server application (C#2008) which is stays on public IP, connected to SQL and distributes data between hundreds of PLC'c: https://dl.dropboxusercontent.com/u/61256880/Unitronics/VL_Connect.7z This link to Visilogic subroutine that actually executes PLC client function: https://dl.dropboxusercontent.com/u/61256880/Unitronics/GetPortNumber.7z
  4. Here the "old times" Unitronics examples for Excel and VB6. https://dl.dropboxusercontent.com/u/61256880/_CommDriver%20Example.zip Did not find it on the new Unitronics website, so I attached the copy from my archive. PS: You can use the only 32-bit Excel
  5. In addition to the logic that you already have, I would recommend you to select one controller that will lead, control and synchronize the process.Otherwise you can fall into egg and chicken loop.
  6. You need to write application and modify your PLC project. There is many ways to do that. The best way depends on your specific requirements. I have similar server application that distributes data from SQL across hundreds of V-570 PLC's: each controller connects to the server on port 20257 once per 5 min, provide his ID and receives relevant data.
  7. Joe, have not find anything wrong in your test, I have similar code and it works without any problems. Only 2 advises: 1. try to avoid binding UDP sockets to ports 20000-20255 2. initiate socket every time prior to calling DNS server and bind it to different port. By using same source port you may hit "Unidirectional Link Detection" implemented in the most of switches
  8. From visilogic menu try Build>Build All, then download project again. From my experience, Modbus never works well after conversion without rebuilding the project.
  9. In the case of Port forwarding, PLC works the same way as any other PC. If you set correctly PFW in the router, and you can connect to PLC locally but not externally, than the most common mistake is wrong Gateway address in PLC. Some networks may have multiple gateways (ex: Data & Voice). you have to set PLC to the one, you are using for port forwarding. P.S. Ping is useless to diagnose forwarded devices. The response comes from the router, not from the device.
  10. I was assuming that the output message is all ASCII. If your string is ASCII with control characters in <>, and ASCII variables in [ ], then yes - you are right and your line should work. The only concern is a blank space before <STX>. But you can remove it with vector "Shift Left" under vector menu: For test you have 2 options: 1. PLC info mode: Go to Info Mode->Ethernet->Monitor. Select "Port 2" and you will see every incoming and outgoing packet in ASCII or binary.(In this case you will need to trigger transmission from visilogic debug mode since the di
  11. You are right about UDP RAW Encoding is easy, try to use 'Create Excel delimited line" under SD menu (see attachment) Socket 2 init is correct, Socket 1 init is not necessary, but I would add it as well for cases when backup battery is fails. I did not test my suggestion, so if any questions, please reply Good luck
  12. OK, here is how standard Modbus slave looks: And here how ModBus SCAN can be in your own code (Example for Modbus over TCP, but UDP would be very much the same): Subs 1.ProcessModbusRequest and 3.ComposeModbusResponce should be written based on Modbus protocol description. Modbus is a public protocol and description you can find on http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf In the sub 2.ValidateModbusRequest you should put your specific validation requirement. No doubts, this it is a piece of work. But it doable. So you should consider, if yo
  13. From my point of view, the only way to restrict ModBus slave from "unauthorized" requests is to reproduce "ModBus SCAN" in your code using TCP or UDP RAW protocol. Then you can add "Request validation"
  14. 2760005@gmail.com, you can also call me at 843-2760005 In you case there is a different thinks may be wrong, but mostly they are simple.
  15. Just one more tip: Check that PLC Unit ID (SI 8) is the same as in your PCOM request
  16. Danries, On your snapshot i can see only packets from the server, there is no replies from PLC, so it hard to define who terminated the connection, however from PLC side the only reason may be is a small value of SI105 (Socket 2 TCP/IP Keep Alive (units of 100 msec). Try to set it to SI105=50 (5sec). SI143=0 tells that socket configured correctly and SI149=6 - connection was established. The problem may be on the server side. Borth PLC's trying to connect to the same port (502), but again you can see it only on wireshark snapshot of bi-directional traffic .
  17. Can you provide more info: 1. a) What protocol server is using to get the data (PCOM, Modbus or other)? What the values of SI105, SI143 and SI147 at the time of connection (SB149=1)? 2. Install on the server Wireshark, set filter as tcp.port ==502 and capture the trafic . Attach the snapshot.
  18. As Simon mentioned, This is a simple scaling issue. If attached image is the same as you using in visilogic, than you have 1 extra pixel on Y . I corrected it in PS. Try this:
  19. Thanks guys, The code is pretty big since it have complete support for OEM API. On the screen shoot below just the part of the modules. Subs for an image drawing highlighted in yellow: Here is a "Drawing Line" subroutine: https://dl.dropboxusercontent.com/u/61256880/Unitronics/Draw%20Line.vlx
  20. Yes, 16k of pixels (128x126) Every scan it drawing 3 lines (384pxls) in a loop
  21. Receiving BMP file thru RS232 from fingerprint scanner and drawing it on the dispay: [media=] [/media]
  • Create New...