PLC and VB in PC communication...

J

Thread Starter

Jesse

Its regarding PLC MelSec A series,
I don't know whether you are familiar with MelSec A series or not.
Ok, i am currently doing VB programming with this type of PLC, the objective is to receive the number - 100 from PLC.
I used MSComm control to do the communicate, and i wrote it as below:

MSComm1.Output=chr$(&H5)+"00FF0D410"
Temp=MSComm1.Input
MSComm1.Output=chr$($H6)+"00FF"

The first row of coding is to send ENQ to PLC, to ask for enquiry to read and the set Temp as input and the last row is to Acknowledge.

But everytime i run the VB, the different number will be received, even some time i OFF the PLC and the Comm Port. And each time i change the MSComm's setting, for eg: "19200,e,8,2" I will received 30, and if i change to "19200,e,7,2" I will received 29 and so on. And i don't know what had happened to cause this? And i wonder is it related with PC comm port 's conflict? Do you know how to solve it?

Best Regards, Jesse
 
P
Jesse. I'm also experimenting with a similar project, but it seems you have progressed further than me. Do you have any sample code which you would be willing to send me, and, have you had any more responses to your posting wich may help. Many thanks. Pete Stoves [email protected]
 
I am using VB with SLCs and have not had any problems, but I do not use any handshaking. RS232 communications are much more stable then they used to be and I haven't had any problems. Although I do set timers on both sides to resend a message if I don't receive a response in the time expected. I'm not sending critical information this way, and I am not limited in my programs timing ( I send and receive data about every 20 seconds. )

 
hi Paul, could you send me this files that you have working with SLC. I´m a student and i´m looking forward for communication between PC´s and PLC´s. Any file would be great.
Thankful . E-mail : [email protected]
 
G
> I am using VB with SLCs and have not had any problems...<

Paul, I also would like to experiment with your code if you are willing to send it to me. Am trying to learn about SLC comm. Have you incorporated your own comm driver or do you use a commercial version? Thank you. [email protected]
 
Top