Forum Home › Forums › Uncategorized Issues › Input Chanel Size and string format
- This topic has 9 replies, 4 voices, and was last updated 1 week ago by
Mikhail.
-
AuthorPosts
-
December 10, 2020 at 9:33 pm #7707
diam2513
ParticipantGood Day,
I have create a device to import some information form our database to Scada. The device is working good but the problem is, our order number are of String type. For exemple 297438-12R10S is an order number. But after reading the database, the input chanel in ASCII format display 297438-1 and not 297438-12R10S, I think the inputs chanels are designed for 64bits only. Is it possible to increase the size ? Or maybe create another format that support strings ?
Thank you in advance for your response.December 11, 2020 at 3:53 pm #7713
MikhailModeratorHello,
1 input channel can contain only 8 Latin characters. You could split your order number into 2 strings and store it in 2 input channels.
We will implement long strings in the next generation of the software.
December 13, 2020 at 5:07 pm #7721diam2513
ParticipantThank you for you answer Mikhail
December 29, 2025 at 11:39 pm #17507Fou
ParticipantStill 8 caractere long?
December 30, 2025 at 6:09 am #17508
manjey73ParticipantIn version 6, it is now possible to combine channels into an array. To do this, specify the length of the data in the channel table.
An example of text notes.
NoteDecember 30, 2025 at 12:41 pm #17509
MikhailModeratorSet the Data Length property of a channel.
Channel of length 1 can contain up to 4 Unicode characters.
If channel length > 1, virtual channels are created in memory. So the number (ID) of the next channel must be the number of the current channel + data length.December 31, 2025 at 1:53 am #17510Fou
ParticipantI have put a length of 4 but it just replicate the 4 caracteres 4 times
January 1, 2026 at 10:42 am #17512
manjey73ParticipantDataType = UnicodeString
Format – String
InputScript =SplitUnicode(()=> "10-PME-01")The string must be divided by the channels of the array
January 1, 2026 at 9:14 pm #17513Fou
ParticipantThank you! work fine. i have use Ascii instead to reduce the number of channel.
SplitAscii(()=> “10-PMPE-01”)
January 2, 2026 at 12:04 pm #17515
MikhailModeratorThe above formula useful for constant strings.
If you need to set a string channel manually, use the output formula SetUnicode(). Input formula is empty.public byte[] SetUnicode() { if (ArrIdx == 0) { string s = CmdData == null ? "null" : Encoding.UTF8.GetString(CmdData); int dataSize = Channel.DataLen ?? 1; for (int i = 0; i < dataSize; i++) { string part = Substring(s, i * 4, 4); SetData(CnlNum + i, EncodeUnicode(part), 1); } } return CmdData; }SetAscii() can be developed in a similar way.
-
AuthorPosts
- You must be logged in to reply to this topic.