String Error

emilg

Level-1
Beiträge
52
Reaktionspunkte
1
Zuviel Werbung?
-> Hier kostenlos registrieren
Hello

I'm working on a program on a 151GSM controller.
But now i'm seeing a problem with the string i want to send.
I'm using some Concat to make the string for status on some motors.
But now i get at fault message:
A string operation cannot be executed because the destination string is too short. For example, the concat of two strings that contain 50 characters each should be stored to a string with a maximum length of 80 characters.

Is it possible to make the strings longer than 80 charters? ad i remember the sms supports up to 160 charters...

- Emil
 
Hello emlig,

you need to create in the "Data Types" a user defined string.

e.g.:

TYPE
String100 : String(100); (*a string with max. 100 chars*)
String200 : String(200); (*a string with max. 200 chars*)
END_TYPE;
 
No, with the concat function you can merge sub strings where the partial substrings can be greater than 80 chars.
Did you assigned the newly created data types to your variables?

Important: The size of the output string is the sum of the substrings.
e.g.
String1 (100 chars) + String2 (100 chars) = String3 (200 chars)
fbs1.pngfbs2.png
 
What plangner said :)

Just curious, do you really get the fault message that that two 50 character string should be stored in a 80 character string?
If yes, what version of PC worx are you using?

Mark
 
Zuviel Werbung?
-> Hier kostenlos registrieren
I think the problem might be something completely different here, but "... using some Concat ..." is too vague to decide.

If you use chained CONCATs to generate the final string, the connectors between output of a CONCAT and input of the next CONCAT, will be defined as a standard strings with length 80 characters. If the result of the CONCATs is longer, you have to connect a variable to that connector to define a bigger length.

concatchains.jpg

In my example you see lots of "sdummy" variables type "oscat_STRING250" (a predefined variables type in the OSCAT Libraries) to define string connector length to 250 characters. You may use the same variable again and again for the interim results.

Rainer
 
Hello

I got it to work like plangner said, but when i want to transmit it to the Send_SMS block it wont work again. I don't think that the FB Supports more than 80 chars.
I have 8 PLC systems i want to transmit the status of.
The SMS looks like this: "Status
T1=Drift T2=Fejl T3=Drift T4=Drift T5=Drift T6=Drift T7=Drift T8=Drift"

I'm using PcWorx 6.30.1668 AX SW Suite 1.83
It lookslike that PcWorx cant show more than 80 chars, but in the OPC monitor i can see all of them...
 
Hey emilg,

I'm assuming you are talking about the SMS_Send FB.

The Data Input requires an Array of String data type of length 2. Meaning two 80 character long standard strings, which gives you 160 chars in total. Please check the help of the FB your yourself as not all 160 chars can be used (ID & Password).

You can find an example project in the download area of the ILC 151 GSM/GPRS.

Cheers
Mark
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Hey Mark

Thanks. I forgot about the array of strings in the FB. I have only connected to the arrData_String[0] array....
But i think i have the solution now... ;)
Unavngivet.png

Have a nice day
 
Zurück
Oben