Citect GSM Communication

chuah

Member
Join Date
Jul 2011
Location
Puchong
Posts
5
I need to setup a communication between a gsm (maestro 100) and citect
I connected GSM through USB to Serial (RS-232) converter

I run a Communication Express Wizard follow with
1) Selected Driver
Manufacturer : Generic
Model : ASCII Based Protocol Devices
Communication : Serial

2) connect I/O Device to PSTN
- Not Selected

3) Detected Serial Ports:
COM6 (Currently connected to COM6)

4) Link I/O Device to an external tag database
- Not selected

5) Finish
------------------------------------------------------------------------------
After the step I configured the Ports Settings

1) Baud Rate = 115200
Data Bits = 8
Stop Bits = 1
Parity = NONE
Port Name = PORT3_BOARD1
*Note: I tired to connect through Hyper Terminal and is connected and working fine where able to send SMS through Hyper Terminal with the following AT Command

AT+cmgs=016*******
<CR>
>Hello
<Ctrl+Z>
------------------------------------------------------------------------------------
After that I wrote a cicode to call COMOpen() and COMWrite()
the cicode as follow :

INT
FUNCTION StartSerial(STRING sPort)

INT length;
INT SerialWriteError;
INT hPort;
STRING buffer;
STRING CR;
STRING CtrlZ;

hPort = ComOpen(sPort, 0);
IF hPort < 0 THEN
Prompt("Cannot open port " + sPort);
RETURN -1;

ELSE

Prompt("Open Port Success" + sPort);


buffer = "AT+CMGS=0163712151";
length = StrLength(buffer);
SerialWriteError = ComWrite(hPort, buffer, length, -1);
SleepMS(200);


StrSetChar(CR, 0, 13); // put CR into string
StrSetChar(CR, 1, 0); // terminate so may be used as a normal Citect string

buffer = "CR";
length = StrLength(buffer);
SerialWriteError = ComWrite(hPort, buffer, length, -1);
SleepMS(200);


buffer = "test sms";
length = StrLength(buffer);
SerialWriteError = ComWrite(hPort, buffer, length, -1);
SleepMS(200);


StrSetChar(CtrlZ,0,26);
StrSetChar(CtrlZ,1,0);

buffer = "CtrlZ";
length = StrLength(buffer);
SerialWriteError = ComWrite(hPort, buffer, length, -1);
SleepMS(200);

IF SerialWriteError THEN
Prompt ("Error Writing port");
ComReset (hPort);
END
END
RETURN 0;
END

---------------------------------------------------------------------------------------------
Next I created a button to run the cicode function
- StartSerial(PORT3_BOARD1)


----------------------------------------------------------------------------------------------
When I Run the project, from the kernel I found that Unit Offline, the message as follow:

Channel PORT3_BOARD1 is Online
2011/08/04: 29:28.287 Error: Unit Offline
UNIT 000c PORT3_BOARD1 IODev Error_in_CMD-3 16
Generic 000012 Driver 00000256 (0x00000100)


----------------------------------------------------------------------------------------------
How do I Solve this communication failure. My Cicode is correct ?
 

Similar Topics

Hello, the system we use is Scada 7.5 series. We have usb key activ now we need additional key to make the system work, how do we solve this...
Replies
0
Views
68
So i've been at this for a long while, i have Citect Scada 2018, i have full access to everything but i can't seem to find any option or...
Replies
0
Views
79
Hello, i've been at this for months now, i tried creating accounts on the aveva website but it seems to never approve my accounts or at least when...
Replies
3
Views
112
Hello, I have a running project on Citect v5.42 and simatic net v6.4 I have created a new spare PC and loaded all software like Citect, station...
Replies
0
Views
79
Hello everyone, In a factory where we installed Citect 7.20 the computer began to show the first signs of end of life. They never considered...
Replies
0
Views
85
Back
Top Bottom