J
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
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