Hello Friends,
I am new to this forum. And I am new to field of programming of PLC as well. I used Allen Bradley before some years back and now, i have to use Beckhoff PLC for my research work.
I like to read the data from external device for the temperature control. I like to read the data and control through RS 485 port in Beckhoff PLC. The sequence of this PLC (EK 1100 PLC driver,EL6001 Interface and KL 9010 End connector). As CPU,we are using Industrial PC from Beckhoff C69xx. We are using TwinCAT here with Ether CAT field bus.
Can anybody help me to do programming with this ? Or guide me how to proccede with this task ?
I got some sample code by the company provider. Which listed below:
-------------------------------------------------------------
Timer(IN:=TRUE, PT:=T#1s);
IF Timer.Q OR Send.Busy THEN
(*Send( SendString:= '$02Hello World - $03',*)
Send( SendString:= 'S1',
TXbuffer:= TxBuffer1, (* see global variables *)
Busy=> SendBusy,
Error=> SendErrorID);
Timer(IN:=FALSE); (* reset timer *)
END_IF
Receive(
(* Prefix:= '$02',
Suffix:= '$03',
Prefix:= '$N',
Suffix:= '$R',*)
Prefix:= '$0F',
Suffix:= '$12',
Timeout:= T#1s,
ReceivedString:= ReceivedString,
RXbuffer:= RxBuffer1,
StringReceived=> StringReceived,
Busy=> ReceiveBusy,
Error=> ReceiveErrorID,
RxTimeout=> ReceiveTimeout );
IF StringReceived THEN
ReceiveCounter := ReceiveCounter + 1;
LastReceivedString := ReceivedString;
END_IF
COMportControl(
Mode:= SERIALLINEMODE_PC_COM_PORT,
pComIn:= ADR(COMin_COMport),
pComOut:= ADR(COMout_COMport),
SizeComIn:= SIZEOF(COMin_COMport),
TxBuffer:= TxBuffer1,
RxBuffer:= RxBuffer1,
Error=> COMportControlError,
ErrorID=> COMportControlErrorID );
-------------------------------------------------------
While from this programme, i understood that last coding part is for global variables for serial communication. What i should do for COM port communication ? While i can't find much detail in help menu.
Help me out through this.
Regards,
Tech007
I am new to this forum. And I am new to field of programming of PLC as well. I used Allen Bradley before some years back and now, i have to use Beckhoff PLC for my research work.
I like to read the data from external device for the temperature control. I like to read the data and control through RS 485 port in Beckhoff PLC. The sequence of this PLC (EK 1100 PLC driver,EL6001 Interface and KL 9010 End connector). As CPU,we are using Industrial PC from Beckhoff C69xx. We are using TwinCAT here with Ether CAT field bus.
Can anybody help me to do programming with this ? Or guide me how to proccede with this task ?
I got some sample code by the company provider. Which listed below:
-------------------------------------------------------------
Timer(IN:=TRUE, PT:=T#1s);
IF Timer.Q OR Send.Busy THEN
(*Send( SendString:= '$02Hello World - $03',*)
Send( SendString:= 'S1',
TXbuffer:= TxBuffer1, (* see global variables *)
Busy=> SendBusy,
Error=> SendErrorID);
Timer(IN:=FALSE); (* reset timer *)
END_IF
Receive(
(* Prefix:= '$02',
Suffix:= '$03',
Prefix:= '$N',
Suffix:= '$R',*)
Prefix:= '$0F',
Suffix:= '$12',
Timeout:= T#1s,
ReceivedString:= ReceivedString,
RXbuffer:= RxBuffer1,
StringReceived=> StringReceived,
Busy=> ReceiveBusy,
Error=> ReceiveErrorID,
RxTimeout=> ReceiveTimeout );
IF StringReceived THEN
ReceiveCounter := ReceiveCounter + 1;
LastReceivedString := ReceivedString;
END_IF
COMportControl(
Mode:= SERIALLINEMODE_PC_COM_PORT,
pComIn:= ADR(COMin_COMport),
pComOut:= ADR(COMout_COMport),
SizeComIn:= SIZEOF(COMin_COMport),
TxBuffer:= TxBuffer1,
RxBuffer:= RxBuffer1,
Error=> COMportControlError,
ErrorID=> COMportControlErrorID );
-------------------------------------------------------
While from this programme, i understood that last coding part is for global variables for serial communication. What i should do for COM port communication ? While i can't find much detail in help menu.
Help me out through this.
Regards,
Tech007