Input Chanel Size and string format

Forum Home Forums Uncategorized Issues Input Chanel Size and string format

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #7707
    diam2513
    Participant

    Good 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.

    #7713
    Mikhail
    Moderator

    Hello,

    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.

    #7721
    diam2513
    Participant

    Thank you for you answer Mikhail

    #17507
    Fou
    Participant

    Still 8 caractere long?

    #17508
    manjey73
    Participant

    In 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.
    Note

    #17509
    Mikhail
    Moderator

    Set 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.

    #17510
    Fou
    Participant

    I have put a length of 4 but it just replicate the 4 caracteres 4 times

    https://ibb.co/4nFTmn93
    https://ibb.co/xqQJQHcf

    #17512
    manjey73
    Participant

    DataType = UnicodeString
    Format – String
    InputScript = SplitUnicode(()=> "10-PME-01")

    The string must be divided by the channels of the array

    #17513
    Fou
    Participant

    Thank you! work fine. i have use Ascii instead to reduce the number of channel.

    SplitAscii(()=> “10-PMPE-01”)

    #17515
    Mikhail
    Moderator

    The 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.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.