logo Welcome, Guest. Please Login or Register.
November 16, 2018, 01:04:48 PM
Home Help Search Login Register
 News: You can search the forum for answers to your question in a previous discussion. Please click on the "Search" button above and enter the keyword to search. To get to the full discussion of a listed message, please click on the TITLE of the message listed in the search listing.

  Internet PLC Forum
  General
  Frequently Asked Questions
(Moderator: support)
  VBasic comms
? previous next ?
Pages: [1] 2 Go Down Reply Notify of replies Send the topic Print
   Author  Topic: VBasic comms  (Read 13161 times)
Dan Morgan
Guest

E-Mail
VBasic comms
« on: August 28, 2002, 02:26:54 PM »
Reply with quote

Does anyone have some sample code for polling a plc in visual basic 5 or 6? I wrote a small program in qbasic it worked great. But in visbasic I get an echo of Cntrl E but the command always comes back ER*. It's something silly but I don't have a clue.

Thanks for any input.

Dan
Report to moderator   Logged
support
Global Moderator
*****

Posts: 3071





View Profile WWW E-Mail
Re: VBasic comms
« Reply #1 on: February 06, 2003, 04:27:25 PM »
Reply with quote

We have created a sample program in Visual Basic that can handle both point-to-point and multi-point protocol. You can download the program including full source code from the following link:

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

This program allows you to setup the communication parameters and send test host link messages, as shown below:

« Last Edit: December 31, 1969, 07:00:03 PM by -1 » Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
support
Global Moderator
*****

Posts: 3071





View Profile WWW E-Mail
Re:VBasic comms
« Reply #2 on: February 03, 2006, 06:52:02 PM »
Reply with quote

A user Mr Julian Stone of The United Kingdom has kindly contributed a Visual BASIC .NET class and some additional command for communication with the M-series PLCs. The file is located at:

http://www.tri-plc.com/appnotes/VBasicDotNetComm.htm
Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
newbie-06
Newbie
*

Posts: 7



I'm a llama!

View Profile
Re:VBasic comms
« Reply #3 on: June 27, 2010, 02:07:30 PM »
Reply with quote

dear support...
i dunno what's wrong with my PLC TMD100 1616..
i try to connect with TLserver 3.0 using wind XP..
when i type command "IR*", the TLserver reply well, they sent back the response,,,
but when i type command "RVDnnnn*" the TLserver reply "No response from PLC"...
plis help me,,,
thanks a lot, support

for additional hereby i include the screenshoot from TLserver
Report to moderator   Logged
support
Global Moderator
*****

Posts: 3071





View Profile WWW E-Mail
Re:VBasic comms
« Reply #4 on: June 28, 2010, 05:31:40 PM »
Reply with quote

TLServer only supports multi-point protocol except for "IR*" command. So you need to enter "@01RVDxxxx00*" - 00 is the wildcard FCS, but you can also click the "FCS" button to enter the real FCS.

Note that the address is in Hexadecimal notation. So if you want to read DM[3904] you need to convert it to Hexadecimal which is 0F40.
Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
newbie-06
Newbie
*

Posts: 7



I'm a llama!

View Profile
Re:VBasic comms
« Reply #5 on: June 28, 2010, 10:04:33 PM »
Reply with quote

thank you for the answer..
let me try it later..


i must have skipped reading the manual...
« Last Edit: June 28, 2010, 10:10:52 PM by newbie-06 » Report to moderator   Logged
newbie-06
Newbie
*

Posts: 7



I'm a llama!

View Profile
Re:VBasic comms
« Reply #6 on: July 26, 2010, 01:16:04 AM »
Reply with quote

Hai all,,
I'd like to ask again
Im using my laptop for the connection to PLC
Because Laptop has no serial communication, I purchase a usb to rs232 converter
I was using the usb port for communication, the port comm number is around 17, 18, 19
when i was using TLserver there are no problem, but when i was using sample vb6 program from
Code:
http://www.tri-plc.com/applications/SerialComm.zip
i have problem that the combo box "port choice" won't work when the port number is above COM8...
can someone tell me what wrong with the code?

here is the screenshoot



because i need the port opened at COM arround 17,18, 19
thanks before

regards
« Last Edit: July 26, 2010, 01:27:44 AM by newbie-06 » Report to moderator   Logged
support
Global Moderator
*****

Posts: 3071





View Profile WWW E-Mail
Re:VBasic comms
« Reply #7 on: July 26, 2010, 11:21:36 AM »
Reply with quote

You can add the correct COM port number in the COM port list in Visual Basic source code.

Alternatively, you can use the control panel to fix your USB-RS232 adapter to a COM port number that matches one of those shown on VB choice box.
Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
newbie-06
Newbie
*

Posts: 7



I'm a llama!

View Profile
Re:VBasic comms
« Reply #8 on: August 06, 2010, 12:44:57 AM »
Reply with quote

i wanna ask another thing...
this time i wanna try a simple ladder that would be access through TLServer 3.0...


here is the screenshot of the ladder



then here is the screenshot of the TLServer


I type @01WI0101 command
the response should be @01WI*
but the TLServer response was  @01FE42*

I dont understand how that could happen...
or maybe i wrote the wrong command?
« Last Edit: August 06, 2010, 12:45:32 AM by newbie-06 » Report to moderator   Logged
support
Global Moderator
*****

Posts: 3071





View Profile WWW E-Mail
Re:VBasic comms
« Reply #9 on: August 06, 2010, 03:13:40 AM »
Reply with quote

You need to append two bytes of FCS to your command.  You can use TLServer to compute the FCS (click the FCS button!) and then add to the end of the string before *.

For testing you can also use "00" as the wildcard FCS if the PLC is in Automatic protocol mode.
Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
newbie-06
Newbie
*

Posts: 7



I'm a llama!

View Profile
Re:VBasic comms
« Reply #10 on: August 06, 2010, 07:48:54 PM »
Reply with quote

thank you,,
let me try it..

by the way,,
i wanna ask about the data,,,
it says


can u describe about the data?


from my simple ladder,if i wanna turn on the output i have to execute input in channel 01..
but what number i should put on the data?
is it just any number or i have to define it in the ladder or what?
thank you
Report to moderator   Logged
support
Global Moderator
*****

Posts: 3071





View Profile WWW E-Mail
Re:VBasic comms
« Reply #11 on: August 08, 2010, 03:30:28 PM »
Reply with quote

These host commands are for a external host computer or an external PLC to access the PLC's internal I/O via Serial Port or Ethernet port.  These are NOT commands to be used in the ladder program.

What you need to do in the ladder program is to define a label name for each I/O you are using and then create the ladder program by picking the I/O from the I/O definition table.

The channel 01 for say the "WI01" command maps to the input #9 to #16. So if your external PC sends a "WI01FF" serial command to the PLC it will turn on the input #9 to #16. But because the inputs will be refreshed by the PLC program when it does an I/O scan it will be changed again immediately. But the PLC program can actually pick up the effect.

A better demo is to use "WO01FF" which will write to output #9 to #16 and if these are not controlled by the PLC program then they will stay ON after you send the command.
Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
newbie-06
Newbie
*

Posts: 7



I'm a llama!

View Profile
Re:VBasic comms
« Reply #12 on: August 08, 2010, 11:41:49 PM »
Reply with quote

Quote from: support on August 08, 2010, 03:30:28 PM
These host commands are for a external host computer or an external PLC to access the PLC's internal I/O via Serial Port or Ethernet port.  These are NOT commands to be used in the ladder program.

yes, actually i wanna controlled a PLC T100MD1616+ through vb as GUI.
im using vb sample from http://www.tri-plc.com/applications/VBsample.htm#VB6sample#VB6sample
and im working on it right now

Quote from: support on August 08, 2010, 03:30:28 PM
The channel 01 for say the "WI01" command maps to the input #9 to #16. So if your external PC sends a "WI01FF" serial command to the PLC it will turn on the input #9 to #16.

Ooh i see it and i have tried it...
but can i turn on the input #9 without make the input #10 to #16 turn on?
thank you
« Last Edit: August 08, 2010, 11:45:51 PM by newbie-06 » Report to moderator   Logged
support
Global Moderator
*****

Posts: 3071





View Profile WWW E-Mail
Re:VBasic comms
« Reply #13 on: August 09, 2010, 02:04:10 AM »
Reply with quote

Please use the Wb command if you wish to turn on a single bit.
Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
newbie-06
Newbie
*

Posts: 7



I'm a llama!

View Profile
Re:VBasic comms
« Reply #14 on: August 10, 2010, 02:36:07 AM »
Reply with quote

Quote from: support on August 09, 2010, 02:04:10 AM
Please use the Wb command if you wish to turn on a single bit.

thank you for the answer




regards

newbie-06
Report to moderator   Logged
Pages: [1] 2 Go Up Reply Notify of replies Send the topic Print 
? previous next ?
Jump to: 


Login with username, password and session length

Powered by MySQL Powered by PHP Internet PLC Forum | Powered by YaBB SE
© 2001-2004, YaBB SE Dev Team. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!