cz
en

Interpretace časových programů v OPC serveru

Časové programy z Domat MiniPLC přenášené po OPC mohou mít dvě podoby, podle nastavení „Export short TPG“ v OPC serveru.

Oba to vrací jako byteArray.

Klasický je kopie toho co je v RcWare Vision (naší vizualizaci), viz definice tříd dole. Ten krátký je popsán v následujícím textu:

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();
}
}
}

Výjimkové programy se nepřenáší.