Hi,
I used SMS in my WAGO 750-8207 PFC200 2ETH RS 3G with Firmware Revision: 03.01.07 (13) and runtime version: 3.5.15.0 . Everything was ok with SMS communication when I used old library to SMS. Since the old SMS library it stopped working and I had to install new library: CODESYS IIoT Libraries SL.
It turned out there was no structure:
comParam.ComParity: = SMS_RS232.COM_PARITY.NONE; ( No Parity )
comParam.ComStopBit: = SMS_RS232.COM_STOPBIT.ONE; ( One stopbit )
so I change this lines on:
comParam.ComParity: = SMS.COM_PARITY.NONE; ( No Parity )
comParam.ComStopBit: = SMS.COM_STOPBIT.ONE; ( One stopbit )
but SMS communication doesn't work.
What can be wrong? what could be different in this library?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please find in attachment my comport linux configuration . In Codesys should I use port number 5 or 4 ?
(comParam.iPortNumber := 4)
In old library I used port 4. But in the example to new library is 5 used. So ?
The receiving and deleting message works . I have a problem with sending message. It is a minimal time beetwen execute receive function and execute send function ?
Last edit: damian177 2020-10-09
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
CODEreconnect_timepout(IN :=(iState=32767) , PT:=T#1M);IFModemFb.xErrorTHENerr_modem :=TRUE;ELSEerr_modem :=FALSE;END_IF//initIFNOTxInitTHENxInit :=TRUE; (* This values should be device specific adapted *)comParam.iPortNumber :=4; (* used com port number 1 *) comParam.ComParity :=SMS.COM_PARITY.NONE; (* No Parity *)comParam.ComStopBit :=SMS.COM_STOPBIT.ONE; (* One stopbit *) comParam.dwBaudrate :=9600; (* Baudrate of 9600 *)comParam.byByteSize :=8; (* Byte size is 8 *)(*Nohardwarehandshakeisused. Whenthedeviceneedshardwarehandshakeanditissettofalse, itcanresultindataloss.*)comParam.byHardwareHandshake :=FALSE; comParam.bySoftwareHandshake :=FALSE; (* No software handshake is used. *)comConnect.COMParameter :=comParam; (* set the parameter to the instance of the function block *)ModemFb.itfConnectionType :=comConnect; (* set the connection instance to the modem, that it can connect to the physical device.*)//SendSmsFb.smsInfo.sServiceCenterNr :=''; err_modem :=FALSE;END_IFCASEiStateOF0:
ModemFb(xExecute :=TRUE, sPin :=scPin, udiTimeOut :=120000000);IFModemFb.xDoneTHENiState :=1;ELSIFModemFb.xErrorTHENiState :=32767;END_IF1:
ReceiveSmsFb(xExecute:=TRUE, ModemFB :=ModemFb, udiTimeOut :=10000000);IFReceiveSmsFb.xDoneORReceiveSmsFb.xErrorTHENsmsrec :=ReceiveSmsFb.smsRecv;ReceiveSmsFb(xExecute :=FALSE, ModemFB :=ModemFb);iState :=20;END_IF20:
IFSend_MessageTHENiState :=200;ELSEIFsmsrec.sText<>''THENpt:=ADR(smsrec.sText); // Get the Address of the text variable FORi:=0TOLEN(smsrec.sText)DOchar[i]:=pt^; // Assign the value of the pointer to a Characterpt:=pt+1; // Advance to the next pointerEND_FORiState :=21;ELSEiState:=1;END_IF;END_IF;21:
IFsmsrec.sNumber='XXXXXXXXX'THENiState :=22;ELSEiState :=100;END_IF;22:
timestamp_hist_hi :=time_sys.udiLocal_DateAndTime+timestamp_hist;timestamp_hist_lo :=time_sys.udiLocal_DateAndTime-timestamp_hist;IF(DT_TO_UDINT(smsrec.dtSend)<timestamp_hist_lo)OR(DT_TO_UDINT(smsrec.dtSend)>timestamp_hist_hi)THENiState :=100;ELSEiState :=23;END_IF23: IFsmsrec.sText='ON1'THENbool_out_sms:=1;iState :=100;ELSEIFsmsrec.sText='OFF1'THENbool_out_sms:=0;iState :=100;ELSEiState :=100;END_IF;END_IF;100:
DeleteSmsFb(xExecute:=TRUE, ModemFB :=ModemFb, sms :=sms_sys.ReceiveSmsFb.smsRecv, udiTimeOut :=10000000);IFDeleteSmsFb.xDoneORDeleteSmsFb.xErrorTHEN(*Thiswillresetthefunctionblockandreleasethemodemlock.*)DeleteSmsFb(xExecute :=FALSE, ModemFB :=sms_sys.ModemFb, sms :=smsrec);//xExecute_Delete_trig:=FALSE;iState :=1;END_IF; 200:
SMS_to_send.sNumber :='XXXXXXXXX';Send_Message:=FALSE;SendSmsFb(xExecute:=TRUE, ModemFb :=ModemFb, udiTimeOut :=10000000, smsInfo:=SMS_to_send);IFSendSmsFb.xDoneORSendSmsFb.xErrorTHEN(*Thiswillresetthefunctionblockandreleasethemodemlock.*)SendSmsFb(xExecute :=FALSE, ModemFb :=ModemFb);iState:=1;err_send :=SendSmsFb.eError; END_IF32767: (*error*);IFreconnect_timepout.QTHENxInit :=FALSE;iState :=0;END_IFEND_CASERTRIG_LICZs1_SMS(CLK:=(time_sys.todNow=TOD#22:00:00)OR(time_sys.todNow=TOD#21:54:10));IFRTRIG_LICZs1_SMS.QTHENzm_temp :=CONCAT('With SMS ', 'everything');zm_temp :=CONCAT(zm_temp,' OK :)');SMS_to_send.sText :=zm_temp;Send_Message :=TRUE;END_IF
Last edit: damian177 2020-10-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I upload to PLC and Build->Clean all and RUN PLC. Everything works perfectly but after several minutes sms doesn't work. Without any error. What can be wrong ? Something with memory ? I should something cleaning ?
Last edit: damian177 2020-10-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
all prodcuts which have the 'SL' (single license) in the product name need the license activation on plc side.(not on the CODESYS development system machine)
So this license you need to activate in the PFC200, this screenshot is your CODESYS pc softcontainer?
So please write to the CODESYS Store -> my question -> bug report - you need a remove ticket and a new ticket for your PFC200.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I used SMS in my WAGO 750-8207 PFC200 2ETH RS 3G with Firmware Revision: 03.01.07 (13) and runtime version: 3.5.15.0 . Everything was ok with SMS communication when I used old library to SMS. Since the old SMS library it stopped working and I had to install new library: CODESYS IIoT Libraries SL.
It turned out there was no structure:
comParam.ComParity: = SMS_RS232.COM_PARITY.NONE; ( No Parity )
comParam.ComStopBit: = SMS_RS232.COM_STOPBIT.ONE; ( One stopbit )
so I change this lines on:
comParam.ComParity: = SMS.COM_PARITY.NONE; ( No Parity )
comParam.ComStopBit: = SMS.COM_STOPBIT.ONE; ( One stopbit )
but SMS communication doesn't work.
What can be wrong? what could be different in this library?
more posts ...
What should I do now, what check? Someone test SMS communication in IIoT Libraries SL ?
Please find in attachment my comport linux configuration . In Codesys should I use port number 5 or 4 ?
(comParam.iPortNumber := 4)
In old library I used port 4. But in the example to new library is 5 used. So ?
would try 4..
I all the time try with 4- but doesn't work. and do not have any error.
The receiving and deleting message works . I have a problem with sending message. It is a minimal time beetwen execute receive function and execute send function ?
Last edit: damian177 2020-10-09
It is my code:
Last edit: damian177 2020-10-11
Let's focus on receiving messages Can I perform the receive function every cycle?
When I upload to PLC and Build->Clean all and RUN PLC. Everything works perfectly but after several minutes sms doesn't work. Without any error. What can be wrong ? Something with memory ? I should something cleaning ?
Last edit: damian177 2020-10-11
Probably I found problem . When I run my PLC in log i noticed that my library is not installed - like attachement "licencja.jpg"
How it is possible ??? I have installed library - please find in attachement
Hi,
all prodcuts which have the 'SL' (single license) in the product name need the license activation on plc side.(not on the CODESYS development system machine)
So this license you need to activate in the PFC200, this screenshot is your CODESYS pc softcontainer?
So please write to the CODESYS Store -> my question -> bug report - you need a remove ticket and a new ticket for your PFC200.
Yes I have this license installed on Workstation->Softcontainer.
When I remove license form Workstation it will be works ? When I did not have license in workstation I had many error during compilation my project.
Yes this will work...
After install license SMS function not even initialization...:/