Author Topic: PLC commands  (Read 14878 times)

dppcw

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
PLC commands
« on: April 25, 2005, 11:51:06 AM »
I have a program to get data from a plc with VB. I need to type a command and send it to the plc. Where do I find support for these commands

Thanks

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:PLC commands
« Reply #1 on: April 25, 2005, 12:13:20 PM »
For M-series PLC, please check the T100MD+ User's Manual (light blue cover). For H-series, it is in the  H-series User's Manual (light green cover). For E10-npn+ there is a link at our website to download the host link command page.

If it is not our PLC, please do not pose the questions here. Thank you.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

dppcw

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:PLC commands
« Reply #2 on: April 25, 2005, 01:48:18 PM »
I have an M series. I get a "no response from PLC" message. Does this mean that i am entering the wrong command??

Thanks

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:PLC commands
« Reply #3 on: April 25, 2005, 03:16:01 PM »
Are you using the VB example programs downloaded from our website? If not, please download it from:

  http://www.tri-plc.com/applications/VBsample.htm

The most fundamental command that all the PLC will response is:

IR*

Please try to enter the above command (note they are capital letters (i.e. "IR", not "ir") at the "Command Prompt" string and you shoudl receive a response string telling you the ID of the PLC. E.g. a PLC with ID of 01 will return "IR01*".

If you don't even receive a response from IR, then most likely your com port choice is wrong or other hardware related issues.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

dppcw

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:PLC commands
« Reply #4 on: April 26, 2005, 02:26:02 PM »
Could I so the same thing over the network? The plc is connected to the network and I can communicate with excel link. Could I retrieve data from it from a remote computer? If so. how? Thanks

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:PLC commands
« Reply #5 on: April 26, 2005, 04:49:52 PM »
If you write program in Java, then you can obtain a plcmon.jar API from us that allow you to access a remotely located TLServer via the LAN or the Internet. You need the API in order to login to TLServer using some proprietary encryption method. However, at the moment we don't have any API library for Visual Basic to enable the same functionality.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

dppcw

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:PLC commands
« Reply #6 on: April 26, 2005, 05:32:13 PM »
Would I use the same commands to access data over the network. How does excel link retrieve data? Would I use a udp connection?

Thanks

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:PLC commands
« Reply #7 on: April 27, 2005, 10:51:41 AM »
To use ExcelLink, A PC must be running the TLServer program and connected to the PLC.  However, ExcelLink software can be running on a different PC but linked to the same network.  ExcelLink incorporates our PLCmon.jar API library which enable it to talk to a remote TLServer on the network and the TLServer in turn relays the messages to the PLC via RS232 port.

In other words, TLServer acts as a TCP/IP gateway for the PLC. If you wish to permanently connect the PLC to the network without having a PC running TLServer 24/7, then you can purchase the optional Ethernet XServer which take the place of the PC + TLServer.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

dppcw

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:PLC commands
« Reply #8 on: April 30, 2005, 02:13:38 PM »
how do i send a "start" command with VB? Do i write inputs? if so do i write WI00... what goes into the data portion???

Thanks

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:PLC commands
« Reply #9 on: May 01, 2005, 07:46:45 AM »
You can write to the PLC inputs using "WInnxx" but it will only affect the PLC input logic state for one scan time, at the end of the ladder logic scan the  input  logic state will be updated with the actual physical input state. But often that 1 scan time of input changes is sufficient to force start a process.  A better method may be to change an internal relay and use the internal relay contact to trigger a process. That can be accomplished by  "WRnnxx" command. "xx" is the 8-bit data for the whole 8 bit channel.

However, note that  both WI and WR affects 8 bits at a time. So normally you will have to read the current state of the channel and then just alter one bit (use the SETBIT or CLRBIT command) and write the channel data back to the input or relay channel. This ensure that you don't affect other inputs.

Another possibility is to use the "Wbnnnnxx" command to change only a single bit  if your firmware revision is at least r47 or above. (Use the "Get PLC Hardware Info" command in TRiLOGI to check the firmware revision).  This is a better and faster method to turn on/off a single bit on the PLC..
« Last Edit: May 01, 2005, 07:48:17 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS