tech007

MrPLC Member
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About tech007

  • Rank
    Newbie

Profile Information

  • Country Germany
  1. Stepper Motor Control

    Hello People, I have stepper motor with beckhoff system. I got prepaired programme in .pro and .tsm with file. I have to test this product in diffrent ways. The beckhoff module are : EL1100,EL1034,EL2002,EL 7041,EL 9505,EL 9011 This application have linear encoder to read the actual position. But i am not sure that this motor is in close loop or not. As per my understanding, EL7041 module responsible for controlling the steps and taking feed back from the encoder. But how to find out that this stepper motor is in close loop ? And if it is in close loop then how can i make in lopen loop ? I didn't find specifically something in .tsm file for this Drive and encoder system. Thanks.
  2. I write code for serial communication to read and write data from the external device in Twin CAT. I use the moduels Ek1100,EL6010 and EL 9001. The programme is all right and the programme is getting string too as answer which is correct. Problem is, I don’t need whole string but i want only some data from that. For that I used the some string function like MID. Find the code below for this: Example : LastReceivedString = 'xyz45.23abc' Here, LastReceivedString is variable and it's data is 'xyz45.23abc'. Code: ---------------------- VAR sTemp : STRING; END_VAR ------------------------ ... sTemp := MID(LastReceivedString, 5, 4); When i am using this function as per above example, the problem is it's not acting on the data from the device which is here 'xyz45.23abc' insted of it's acting on variable name 'LastReceivedString'. So, what i am getting result with this is , =tRece insted of 45.23. Can you help me how to read out specific required data through the whole string? It's quite urgent if you can help through this. Thanks.
  3. Serial Communication - EL 6001 in TwinCAT

    I got again question regarding same. Now, finally the programme is runrining with small changes. I got strings from the Device which i am expecting. But i have problem that i don't want that whole string but i just want to read the temperature from it. I used some function of string but it's not working out. Programme find below : ---------------------------------------------------------------------------- Timer(IN:=TRUE, PT:=T#10s); IF Timer.Q THEN Receive( Prefix:= '< >', Suffix:= '< >', Timeout:= T#10s, ReceivedString:= ReceivedString, RXbuffer:= RxBuffer2, StringReceived=> StringReceived, Busy=> ReceiveBusy, Error=> ReceiveErrorID, RxTimeout=> ReceiveTimeout ); IF StringReceived =TRUE THEN ReceiveCounter := ReceiveCounter + 1; LastReceivedString := ReceivedString; diff_string := FIND ('ReceivedString','LastReceivedString'); concen := CONCAT ('ReceivedString','LastReceivedString'); change := MID ('LastReceivedString',6,31); END_IF END_IF ------------------------------------------------------------------------------ Variables : Receive: ReceiveString; ReceivedString: STRING; LastReceivedString: STRING; StringReceived: BOOL; ReceiveBusy: BOOL; ReceiveError: BOOL; ReceiveErrorID: ComError_t; ReceiveTimeout: BOOL; ReceiveCounter: UDINT; ------------------------------------------------------------------------------- This is the varibale which get the string from the device i.e.''LastReceivedString ''. But as you can see, MID function or CONCAT function are only actining on this varible Lable not Actual data from the device. For example, diff_string variable result ideally should find data diffrence from the both varible insted of that it is making diffrence of name for both varible not the actual data. I like to separate the Temperatue reading from the whole string which lengh is 81. Insten of that, this string function, will not act on this string rather than only label of LastReceviedString. Can you give idea how to take out or read out only selected data from the whole string ? I am using the same module as i mentioned before i.e. Ek1100 , EL 6010 and EL9010. Thanks.
  4. Serial Communication - EL 6001 in TwinCAT

    The error was : Undefined types. But after this, i spoke to Local Beckhoff PLC and realise that KL6InData22B and KL6OutData22B are having same image. So, doesn't matter identically. Regarding prefix and suffix, actually are wrong. I wil change it. But still, this is the sample programme to send and receive the string. It works fine. Main task i have is to read the temperature through RS 232 communication from temperature mesurment device. So, for that i am using only Receive string programme but it's not working. I spoke to beckhoff local support and they said everything is all right. Even, module (EL 6001) interface setting is also seems to be correct. But i am not getting data. BaudRate and time is also correct. I don't know why i can't detect data from temperature mesurment (Almemo 5690-2) ?!!! I mean even not in programme but also in Twin CAT System Manager i am not getting the data. That's quite shock for me. Because programme just manuplate or control the data from Twin CAT System Manager nothing more. Even module seems to be also all right. And i don't know how to define prefix or suffix for that device but if i don't define then technicall it's all right and data should come. Can you give me suggestion or tips regarding same ? Or if you have sample project to read temperature then it can be also great help. Please find the programme below : Thanking you. --------------------------------------------------------------------------------------------------------------------------------------- Timer(IN:=TRUE, PT:=T#1s); IF Timer.Q OR Receive.Busy THEN Receive( Prefix:= ' ', Suffix:= ' ', Timeout:= T#1s, ReceivedString:= ReceivedString, RXbuffer:= RxBuffer2, StringReceived=> StringReceived, Busy=> ReceiveBusy, Error=> ReceiveErrorID, RxTimeout=> ReceiveTimeout ); IF StringReceived THEN ReceiveCounter := ReceiveCounter + 1; LastReceivedString := ReceivedString; END_IF Timer(IN:=FALSE); (* reset timer *) END_IF IF StringReceived THEN b:= STRING_TO_BYTE('LastReceivedString'); END_IF (*================================================================== Background communication with EL6001 terminal *) COMportControl( Mode:= SERIALLINEMODE_EL6_22B, pComIn:= ADR(COMin_EL6001), (* I/O data; see global variables *) pComOut:= ADR(COMout_EL6001), (* I/O data; see global variables *) SizeComIn:= SIZEOF(COMin_EL6001), (* I/O data; see global variables *) TxBuffer:= TxBuffer2, (* Transmit buffer; see global variables *) RxBuffer:= RxBuffer2, (* Receive buffer; see global variables *) Error=> COMportControlError, ErrorID=> COMportControlErrorID ); ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  5. 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 through RS 242 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 ? The programme is below. I can send and receive the sring but i can't read the temperature.I check the baudrate and other thing is all right. But still i can't read it. The code is mentioned 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_EL6_22B, pComIn:= ADR(COMin_EL6001), (* I/O data; see global variables *) pComOut:= ADR(COMout_EL6001), (* I/O data; see global variables *) SizeComIn:= SIZEOF(COMin_EL6001), (* I/O data; see global variables *) TxBuffer:= TxBuffer2, (* Transmit buffer; see global variables *) RxBuffer:= RxBuffer2, (* Receive buffer; see global variables *) Error=> COMportControlError, ErrorID=> COMportControlErrorID ); ------------------------------------------------------------------- Variables : RxBuffer2: ComBuffer; (* Receive data buffer; used with all receive function blocks *) TxBuffer2: ComBuffer; (* Transmit data buffer; used with all receive function blocks *) COMin_EL6001 AT %IB66 : KL6inData22B; (*Linked with EL6001TwinCAT System Manager *) COMout_EL6001 AT %QB66 : KL6outData22B;(*Linked with EL6001TwinCAT System Manager *) ------------------------------------------------------- I all configure 22 bytes of Input and Output from the EL6001 Module. I want to take daata types EL6inData22B and EL6outData22B respectively but i am getting error that unknown type ??!! Help me out through this. It's quite urgent. Thanks in advance. Tech007