en
cz

Interpretation of time programs in the OPC server

Time programs from Domat MiniPLC transmitted via OPC can take two forms, depending on the "Export short TPG" setting in the OPC server.

They both return it as a byteArray.

A classic is a copy of what is in RcWare Vision (our visualization), see the class definitions below. The short one is described in the following text:

Short TPG

Created as solution for Citec – SoftPLC communication. Telegram structure is as follows:

  • array of 112 double-byte values is returned (ushort[112])
  • fixed structure of 8 changes per day
  • not used change positions are filled with pattern FF FF
  • each change takes 2 ushorts:
  • the first ushort holds time from beginning of the day in minutes (hours * 60 + minutes)
  • the second ushort represents the new state („function“): 0/1 if bool, 0…n if integer time program
  • 8 changes * 7 days * 2 ushorts_per_change = 112 ushorts array = 224 bytes

There has to be checked Export TPG in a short form as well (usable in Citect for example) option in SoftPLC OPC server configuration when short TPG is needed.

A tady ta RcWare Vision struktura (vrací to RCTPGWeek):

class RCTPGDayTransition
{
public long hour;
public long minute;
public long second;
public uint function;
}

class RCTPGDay
{
public ArrayList tarnsitions = new ArrayList();
}

class RCTPGWeek
{
public RCTPGDay[] days;

public RCTPGWeek()
{
days = new RCTPGDay[7];
for (int a = 0; a < 7; a++)
{
days[a] = new RCTPGDay();
}
}
}

Exception programs are not transmitted.