Appendici

Tabella istruzioni IL

Istruzione Operandi Descrizione
LD Tutti Carica il valore operando nell’accumulatore
LDN Tutti Carica il valore negato operando nell’accumulatore
ST Tutti Trasferisce il valore dell’accumulatore nell’operando
STN Tutti Trasferisce il valore negato dell’accumulatore nell’operando
S BOOL Setta l’operando (Accetta solo BOOL) se l’accumulatore è TRUE
R BOOL Resetta l’operando (Accetta solo BOOL) se l’accumulatore è TRUE
AND Tutti meno REAL AND a bit tra accumulatore e valore operando, risultato in accumulatore
ANDN Tutti meno REAL AND a bit tra accumulatore e valore negato operando, risultato in accumulatore
OR Tutti meno REAL OR a bit tra accumulatore e valore operando, risultato in accumulatore
ORN Tutti meno REAL OR a bit tra accumulatore e valore negato operando, risultato in accumulatore
XOR Tutti meno REAL XOR a bit tra accumulatore e valore operando, risultato in accumulatore
XORN Tutti meno REAL XOR a bit tra accumulatore e valore negato operando, risultato in accumulatore
NOT   Esegue l’inversione a bit del valore in accumulatore
ADD Tutti meno BOOL Somma tra accumulatore e valore operando, risultato in accumulatore
SUB Tutti meno BOOL Sottrazione tra accumulatore e valore operando, risultato in accumulatore
MUL Tutti meno BOOL Moltiplicazione tra accumulatore e valore operando, risultato in accumulatore
DIV Tutti meno BOOL Divisione tra accumulatore e valore operando, risultato in accumulatore
MOD Tutti meno BOOL Ritorna il modulo della divisione nell’accumulatore
GT Tutti meno BOOL Controlla se accumulatore > operando, risultato (BOOL) in accumulatore
GE Tutti meno BOOL Controlla se accumulatore >= operando, risultato (BOOL) in accumulatore
EQ Tutti meno BOOL Controlla se accumulatore = operando, risultato (BOOL) in accumulatore
NE Tutti meno BOOL Controlla se accumulatore <> operando, risultato (BOOL) in accumulatore
LE Tutti meno BOOL Controlla se accumulatore <= operando, risultato (BOOL) in accumulatore
LT Tutti meno BOOL Controlla se accumulatore < operando, risultato (BOOL) in accumulatore
JMP Etichetta Salta incondizionatamente su etichetta
JMPC Etichetta Salta su etichetta se accumulatore diverso da zero
JMPCN Etichetta Salta su etichetta se accumulatore uguale a zero
CAL FB Esegue incondizionatamente il blocco funzione
CALC FB Esegue blocco funzione se accumulatore diverso da zero
CALCN FB Esegue blocco funzione se accumulatore uguale a zero
RET   Ritorna incondizionatamente al programma che ha eseguito CALL
RETC   Ritorna al programma che ha eseguito CALL se accumulatore diverso da zero

Operatori linguaggio ST

Nella tabella seguente sono riportati gli operatori utilizzabili nel linguaggio ST. Gli operatori sono riportati in tabella in base alla loro priorità, dall’alto verso il basso, quindi le parentesi hanno priorità maggiore su tutti gli altri operatori.

Operatore Simbolo Esempio
Parenthesization (Espressione)  
Function evaluation Funzione(Argomenti) LN(A), MAX(X,Y), etc.
Negation
 
Complement NOT  
Exponentiation **  
Multiply *  
Divide /  
Modulo MOD  
Add
 
Subtract
 
Comparison < , > , <= , >=  
Equality =  
Inequality <>  
Boolean AND &  
Boolean AND AND  
Boolean Exclusive OR XOR  
Boolean OR OR  

Statements linguaggio ST

Nella tabella seguente sono riportati gli operatori utilizzabili nel linguaggio ST. Gli operatori sono riportati in tabella in base alla loro priorità, dall’alto verso il basso, quindi le parentesi hanno priorità maggiore su tutti gli altri operatori.

Statement Esempio
Assignment A:=B; CV:=CV+1; C:=SIN(X);
FB Invocation and output usage

CMD_TMR(IN:=%IX5, PT:=T#300ms);

A:=CMD_TMR.Q;

RETURN RETURN;
IF

D:=B*B-4*A*C;

IF D < 0.0 THEN NROOTS:=0;

ELSIF D=0.0 THEN

NROOTS:=1;

X1:=-B/(2.0*A);

ELSE

NROOTS:=2;

X1:=(-B+SQRT(D))/(2.0*A);

X2:=(-B-SQRT(D))/(2.0*A);

END_IF;

CASE

TW:=BCD_TO_INT(THUMBWHEEL);

TW_ERROR:=0;

CASE TW OF

1,5: DISPLAY:=OVEN_TEMP;

2: DISPLAY:=MOTOR_SPEED;

3: DISPLAY:=GROSS-TARE;

4,6..10: DISPLAY:=STATUS(TW-4);

ELSE

DISPLAY:=0;

TW_ERROR:=1;

END_CASE;

QW100:=INT_TO_BCD(DISPLAY);

FOR

J:=101;

FOR I:=1 TO 100 BY 2 DO

IF WORDS[I]=”KEY” THEN

J:=I;

EXIT;

END_IF;

END_FOR;

WHILE

J:=1;

WHILE J <= 100 & WORDS[J]<>”KEY” DO

J:=J+2;

END_WHILE;

REPEAT

J:=-1;

REPEAT

J:=J+2;

UNTIL J=101 OR WORDS[J]=”KEY”

END_REPEAT ;

EXIT Exit from iterations (FOR, WHILE, REPEAT) EXIT;
Empty Statement ;

ID oggetti

Tutti gli oggetti (Funzioni e/o blocchi funzione) hanno un identificativo univoco che li contraddistingue. L’ID è ritornato anche nell’eventuale codice di errore (Riferimento alla funzione SysGetLastError ed alla variabile SysLastError). Il codice di errore si compone dell’ID oggetto seguito da 3 cifre che indicano il codice di errore.

Di seguito la tabella degli ID oggetti. Il simbolo (●) indica che l’oggetto è obsoleto. Sugli oggetti obsoleti è riportata tra parentesi l’ultima versione di libreria e di manuale in cui l’oggetto era presente.

ID Oggetto
9923 (000 ÷ 999) Program code extension
9924 (000 ÷ 999) SysOSIDValue <#FctSysOSIDValue> __, get or set an operating system variable
9925 (000 ÷ 999) SysMemFind, locate a memory area inside another
9926 (000 ÷ 999) SysStrFind, locate a substring inside a string
9927 (000 ÷ 999) Sysstrlen, calculate length of string
9928 (000 ÷ 999) Systoupper, convert a character to upper case
9929 (000 ÷ 999) Systolower, convert a character to lower case
9930 (000 ÷ 999) Sysmemmove, copy bytes between two memory areas
9931 (000 ÷ 999) Sysmemset, fill a memory area with a character
9932 (000 ÷ 999) SysLWVarsnprintf, variable print to string with append
9933 (000 ÷ 999) SysRMAlloc, allocates the relocatable memory
9934 (000 ÷ 999) SysRMFree, frees the relocatable memory
9935 (000 ÷ 999) SysGetEndianness, get the system endianness
9936 (000 ÷ 999) SysGetUTCDateTime, get the system UTC date and time
9937 (000 ÷ 999) SysSetUTCDateTime, set the system UTC date and time
9938 (000 ÷ 999) SysGetCheck , get the check
9939 (000 ÷ 999) SysFIsOpen, get the file open status
9940 (000 ÷ 999) SysTimeZoneAdj, adjust date and time
9941 (000 ÷ 999) SysTCPClient <#FblSysTCPClient> __, opens a TCP/IP connection
9942 (000 ÷ 999) SysTCPServer <#FblSysTCPServer> __, accept TCP/IP connections
9943 (000 ÷ 999) SysUDPClient <#FblSysUDPClient> __, send UDP data stream
9944 (000 ÷ 999) SysUDPServer <#FblSysUDPServer> __, accept UDP data stream
9945 (000 ÷ 999) `SysGetIpInfos <#FblSysGetIpInfos >`__, returns IP infos
9946 (000 ÷ 999) `SysSerialPort <#FblSysSerialPort >`__, manage serial port
9947 (000 ÷ 999) SysMAlloc, memory allocation
9948 (000 ÷ 999) SysSetTaskLpTime, set task loop time
9949 (000 ÷ 999) Funzione embedded
9950 (000 ÷ 999) SysSpyData, system spy data
9951 (000 ÷ 999) SysSetPWMOut <#FblSysSetPWMOut> __, set PWM output
9952 (000 ÷ 999) `SysDirListing <#FblSysDirListing >`__, directory listing
9953 (000 ÷ 999) SysI2CWrRd, writes/reads on I2C extension bus
9954 (000 ÷ 999) SysCANTxMsg , transmit a CAN message
9955 (000 ÷ 999) SysCANRxMsg , receives a CAN message
9956 (000 ÷ 999) SysIsCANRxTxAv, checks if CAN Rx or Tx is available
9957 (000 ÷ 999) `SysCANSetMode <#FctSysCANSetMode >`__, set the CAN controller mode
9958 (000 ÷ 999) Sysfseek, file seek
9959 (000 ÷ 999) `Sysfilelength <#FctSysfilelength >`__, file lengh
9960 (000 ÷ 999) Sysrename, file rename
9961 (000 ÷ 999) Sysremove, file remove
9962 (000 ÷ 999) SysFOBfFlush <#FctSysFOBfFlush> __, file output buffer flush
9963 (000 ÷ 999) SysFOBfClear <#FctSysFOBfClear> __, file output buffer clear
9964 (000 ÷ 999) SysFIBfClear <#FctSysFIBfClear> __, file input buffer clear
9965 (000 ÷ 999) SysFGetOBfSize, get file Tx output buffer size
9966 (000 ÷ 999) SysFGetIBfSize, get file Rx input buffer size
9967 (000 ÷ 999) `SysFGetOSpace <#FctSysFGetOSpace >`__, get output available space on file
9968 (000 ÷ 999) `SysFGetIChars <#FctSysFGetIChars >`__, get input available characters from file
9969 (000 ÷ 999) Sysfwrite, write data to file
9970 (000 ÷ 999) Sysfread, read data from file
9971 (000 ÷ 999) Sysfputc, put character to file
9972 (000 ÷ 999) Sysfgetc, get character from file
9973 (000 ÷ 999) Sysfclose, file close
9974 (000 ÷ 999) SysIPReach, IP address is reachable
● 9975 (000 ÷ 999) SysUDPSktRcv, UDP socket receive (XTarget_12_0, MNL151C080)
● 9976 (000 ÷ 999) SysUDPSktSend, UDP socket send (XTarget_12_0, MNL151C080)
● 9977 (000 ÷ 999) SysSktListen, socket listen (XTarget_12_0, MNL151C080)
● 9978 (000 ÷ 999) SysGetCrc, get CRC value (XTarget_12_0, MNL151C080)
9979 (000 ÷ 999) SysDMXMng, DMX management
9980 (000 ÷ 999) `SysGetEncoder <#FblSysGetEncoder >`__, get encoder input
9981 (000 ÷ 999) `SysGetCounter <#FblSysGetCounter >`__, get counter
9982 (000 ÷ 999) SysSetAnOut , set analog output
9983 (000 ÷ 999) SysGetAnInp , get analog input
9984 (000 ÷ 999) SysSetPhrDO , set peripheral digital output
9985 (000 ÷ 999) SysGetPhrDI , get peripheral digital input
9986 (000 ÷ 999) SysETimeToDate, epoch time to date conversion
9987 (000 ÷ 999) SysDateToETime, date to epoch time conversion
9988 (000 ÷ 999) SysPhrVWr, write variable to peripheral module
9989 (000 ÷ 999) SysPhrVRd, read variable from peripheral module
9990 (000 ÷ 999) SysPhrInfos , get infos from peripheral modules
9991 (000 ÷ 999) SysPCodeAccept, accepts the protection code
9992 (000 ÷ 999) SysSetSerialDTR, set DTR signal status
9993 (000 ÷ 999) SysGetSerialCTS, get serial CTS signal status
9994 (000 ÷ 999) SysSetSerialMode, set serial mode
9995 (000 ÷ 999) SysGetSerialMode, get serial mode
9996 (000 ÷ 999) Sysfopen, file open
9997 (000 ÷ 999) SysVarsnprintf, variable print to string
9998 (000 ÷ 999) `SysVarfprintf <#FctSysVarfprintf >`__, variable print to file
9999 (000 ÷ 999) SysVarsscanf <#FctSysVarsscanf> __, extracts values from string
● 10000 (000 ÷ 999) MDBRTUMASTER, modbus Rtu master (ePLCUtyLib_A400, MNL151B040)
● 10001 (000 ÷ 999) CPUModuleIO, CPU module I/O management (ePLCUtyLib_B000, MNL151C080)
10002 (000 ÷ 999) ModemCore_v5, modem core management
10003 (000 ÷ 999) ModemSMSReceive, receive a SMS message
10004 (000 ÷ 999) ModemSMSRxCmd_v1, receive a SMS command
10005 (000 ÷ 999) ModemSMSSend_v2, send a SMS message
● 10006 (000 ÷ 999) SetSMode, Set serial mode (ePLCUtyLib_B000, MNL151C180)
10007 (000 ÷ 999) ModbusMaster <#FblModbusMaster> __, modbus master
10008 (000 ÷ 999) OWireCore, One-Wire interface core
10009 (000 ÷ 999) OWRdIdentifier, One-Wire read ROM identifier
10010 (000 ÷ 999) OWRdTemperature, One-Wire read temperature
10011 (000 ÷ 999) IODataExchange, exchange data by using logic I/O
10012 (000 ÷ 999) PIDMng _v1, PID management
10013 (000 ÷ 999) STESnmpAcq, STE termometer acquisition over SNMP
10014 (000 ÷ 999) UDPDataTxfer <#FblUDPDataTxfer> __, UDP data transfer
10015 (000 ÷ 999) OWRdHumidity, One-Wire read humidity (ePLC1WireLib_C000, MNL151D000)
10016 (000 ÷ 999) `IEC62056_21Rd <#FblIEC62056_21Rd >`__, IEC62056-21 protocol read
10017 (000 ÷ 999) NMEASInterface_v1, NMEA system interface
10018 (000 ÷ 999) GLLSentence , Geographic Position sentence
● 10019 (000 ÷ 999) ModbusRTUSlave, modbus Rtu slave (ePLCUtyLib_B000, MNL151C020)
10020 (000 ÷ 999) MWVSentence , Wind Speed and Angle sentence
10030 (000 ÷ 999) AuroraDSPMeasure, Aurora measure request to DSP
10031 (000 ÷ 999) `AuroraCEnergy <#FblAuroraCEnergy >`__, Aurora cumulated energy reading
10032 (000 ÷ 999) `sHWgSProtocol <#FblsHWgSProtocol >`__, HW group serial protocol
● 10033 (000 ÷ 999) ModbusAsciiSlave, modbus Ascii slave (ePLCUtyLib_B000, MNL151C020)
10034 (000 ÷ 999) SysLogReport <#FblSysLogReport> __, send a report to Syslog server
10035 (000 ÷ 999) StringToLogFile_v1, store string to a log file
10036 (000 ÷ 999) FileMemoryDump, dump memory on file
10037 (000 ÷ 999) ModemPhoneCall_v1, executes a phone call
10038 (000 ÷ 999) ModbusSlave , modbus slave
10039 (000 ÷ 999) HIDClkDtaReader, HID RFID clock/data reader
10040 (000 ÷ 999) MMasterDataTxfer, multimaster data transfer
10041 (000 ÷ 999) DataTxferClient, Data transfer client
10042 (000 ÷ 999) ModemHTTPGet <#FblModemHTTPGet> __, executes a HTTP Get request
10043 (000 ÷ 999) SpyDataFile , spy data and stores them on a file
10044 (000 ÷ 999) BroadcastDataSend, broadcast data send
10045 (000 ÷ 999) StrainGaugeAcq, strain gauge acquisition
10046 (000 ÷ 999) HMIBuiltInMessages, HMI built in messages
10047 (000 ÷ 999) HMIBuiltInNetlog, Netlog HMI management
10048 (000 ÷ 999) DataStreamExch, exchanges data between two I/O streams
10049 (000 ÷ 999) HMIPicoface , manages Picoface terminal
10050 (000 ÷ 999) ccTalkProtocol, manages the ccTalk protocol
10051 (000 ÷ 999) AlbericiAL66 <#FblAlbericiAL66> __, Alberici AL66 coin acceptor
10052 (000 ÷ 999) SNTPRequest , sends a SNTP request
10053 (000 ÷ 999) ModbusTCPGateway, modbus TCP gateway
10054 (000 ÷ 999) HTTPClient, HTTP client
10055 (000 ÷ 999) DNSProtocol , DNS protocol management
10056 (000 ÷ 999) FIFOFile, manages a FIFO register on a file
10057 (000 ÷ 999) RESTWSvcClient, connects to a REST web service
10058 (000 ÷ 999) RESTSendFct , sends a REST message
10059 (000 ÷ 999) SNMPAgent, manages the SNMP Agent
10060 (000 ÷ 999) SNMPManager , sends a SNMP message
10061 (000 ÷ 999) TCPDataExchServer, TCP data exchange (Server)
10062 (000 ÷ 999) TCPDataExchClient, TCP data exchange (Client)
10063 (000 ÷ 999) FTPClient_v1 <#FblFTPClient_v1> __, connect to a FTP server
10064 (000 ÷ 999) ModbusMsCore <#FblModbusMsCore> __, Modbus master core
10065 (000 ÷ 999) EastronSDM120_v1, Eastron SDM120 energy meter
10066 (000 ÷ 999) 630_v1 , Eastron SDM630 energy meter
10067 (000 ÷ 999) MQTTClient, client for a MQTT server
10068 (000 ÷ 999) Wiegand26Dcd <#FblWiegand26Dcd> __, decodes the Wiegand 26 bits code
10069 (000 ÷ 999) ModbusConversion, Modbus Ascii/RTU conversion
10070 (000 ÷ 999) SAModbusCmd , stand alone Modbus command
10080 (000 ÷ 999) mPowerMini, mFi-mPower mini adapter
10081 (000 ÷ 999) EMailSend, sends an eMail
10082 (000 ÷ 999) CLIManager, manages a command-line user interface
10083 (000 ÷ 999) PushSafer, sends notifications to Pushsafer service

Oggetti obsloleti

Nella evoluzione delle versioni sia del sistema operativo che delle librerie alcuni oggetti sono stati sostituiti da altri oggetti che hanno aggiunto nuove funzionalità. Ecco un elenco degli oggetti diventati obsoleti con il link al nuovo oggetto che può essere utilizzato per sostituirlo. Naturalmente nei progetti LogicLab esistenti è possibile continuare ad utilizzare l’oggetto precedente.

Sugli oggetti obsoleti è riportato tra parentesi l’ultima versione di libreria e di manuale in cui l’oggetto era presente.

Oggetto Sostituito da
SysGetIChars, get input available characters from file (XTarget_12_0, MNL151C080) `SysFGetIChars <#FctSysFGetIChars >`__
SysGetOSpace, get output available space on file (XTarget_12_0, MNL151C080) `SysFGetOSpace <#FctSysFGetOSpace >`__
SysGetRxBSize, get file Rx input buffer size (XTarget_12_0, MNL151C080) SysFGetIBfSize
SysGetTxBSize, get file Tx output buffer size (XTarget_12_0, MNL151C080) SysFGetOBfSize
SysUDPSktRcv, UDP socket receive (XTarget_12_0, MNL151C080) SysUDPServer <#FblSysUDPServer> __
SysUDPSktSend, UDP socket send (XTarget_12_0, MNL151C080) SysUDPClient <#FblSysUDPClient> __
SysSktListen, socket listen (XTarget_12_0, MNL151C080) SysTCPServer <#FblSysTCPServer> __
SysGetCrc, get CRC value (XTarget_12_0, MNL151C080) SysGetCheck
MDBRTUMASTER, modbus Rtu master (ePLCUtyLib_A400, MNL151B040) ModbusMaster <#FblModbusMaster> __
CPUModuleIO, CPU module I/O management (ePLCUtyLib_B000, MNL151C080) Nota (1)
SetSMode, Set serial mode (ePLCUtyLib_B000, MNL151C080) `SysSerialPort <#FblSysSerialPort >`__
DB100AddOffset, returns DB100 address offset (ePLCUtyLib_B000, MNL151C080) Nota (2)
ModbusRTUSlave, modbus Rtu slave (ePLCUtyLib_B000, MNL151C020) ModbusSlave_v1
ModbusAsciiSlave, modbus Ascii slave (ePLCUtyLib_B000, MNL151C020) ModbusSlave_v1
ToLower, Uppercase to lowercase letter conversion (ePLCUtyLib_B000, MNL151C020) Systolower
ToUpper, Lowercase to uppercase letter conversion (ePLCUtyLib_B000, MNL151C020) Systoupper
eLEN, string length (ePLCUtyLib_B000, MNL151C020) Sysstrlen
eFIND, string find (ePLCUtyLib_B000, MNL151C020) SysStrFind
MemSet, memory set (ePLCUtyLib_B000, MNL151C020) Sysmemset
MemCopy, memory copy (ePLCUtyLib_B000, MNL151C020) Sysmemmove
StringToLogFile, store string to a log file (eLLabLogLib_B000, MNL151C090) StringToLogFile_v1
PIDMng, PID management (ePLCUtyLib_C030, MNL151C090) PIDMng_v1
EastronSDM120, Eastron SDM120 energy meter (eLLabMdbDevsLib_A100, MNL151D000) EastronSDM120_v1
EastronSDM630, Eastron SDM630 energy meter (eLLabMdbDevsLib_A100, MNL151D000) EastronSDM630_v1
sOWireMng, One-Wire management (ePLC1WireLib_C000, MNL151D000) OWireCore
SOWRdHumidity, One-Wire read humidity (ePLC1WireLib_C000, MNL151D000) Nota (3)
DataStreamExch, exch. data between two I/O streams (eLLabNetworkLib_A500, MNL151D000) DataStreamExch_v1
FTPClient, connect to a FTP server (eLLabNetworkLib_A200, MNL151D000) FTPClient_v1 <#FblFTPClient_v1> __
HTTPGetPage, get a web page with HTTP protocol (eLLabNetworkLib_A000, MNL151D000) HTTPClient
ModbusTCPGateway, Modbus TCP gateway (eLLabNetworkLib_A000, MNL151D000) ModbusTCPGateway_v1

(1) Gli I/O del modulo CPU sono gestiti automaticamente dal sistema operativo. Allocare gli ingressi come %IX255.x e le uscite come %QX255.x.

  1. E” possibile utilizzare lo statement ADR.

(3) L’FB è stato eliminato perchè non più disponibili i sensori di umidità gestiti.

Tabella codici Ascii

Tabella codici ASCII standard

image0

Tabella codici ASCII estesi

image1