Le script par défaut peut être chargé à partir du FP-I4C et modifié si nécessaire.
Pour charger le script par défaut, allez sur la page “Script”.
Dans l’exemple de script, le symbole "#" indique un commentaire.
#FP-I4C Script (C) Panasonic Industry Europe GmbH 2022
#The script is mainly compatible to the FPWEB script
#Comments are starting with the sharp/hashtag #
#A powerful tool to edit the script is the notepad++ with
#syntax coloring (e.g. with the Python language color scheme)
#This is a sample program to explain some useful functions
#To use a function just remove the starting comment
#character and check the used PLC addresses.
#Further information and more functions are
#explained in the manual.
#=================================================
#Rules:
#DT[x] and R[x] are data from the PLC interface.
#If the PLC interface is set to internal control the data is stored within the FP-I4C.
#Assignment of DT registers with :=
#Standard arithmetic + - * / is allowed
DT[1] := 123;
DT[2] := DT[1] + 2;
#Assignment of R relays
R[3] := 1;
R[4] := R[3];
#=================================================
#The condition with IF is implemented but not ELSE and ELSIF
IF (DT[4] < 20) THEN
DT[4] := DT[4] + 1;END_IF;
#=================================================
#Additional powerful functions
FPWEB_DEBUG(1); #Enable debugging (notification into /var/log/messages)
FPWEB_SLEEP(2); #Wait a little bit (time in seconds)
FPWEB_ECHO("pew_script is running"); #Just a message (see syslog)
#Function to copy data
FPWEB_COPY_DT(interface source, station source, DT source, interface dest, station dest, DT dest, number);
DT[250] := FPWEB_COPY_DT("RS232", 1, 10, "INTERN", 1, 50, 30);
#Function to synchronize the FP-I4C internal clock with the time of the PLC
IF (DT[260] = 1) THEN
DT[260] := 0;
FPWEB_SETCLOCK_RTC(0,90054); #Alternative: FPWEB_SETCLOCK_DATETIME(DDT[264]) with DT formatted time
DDT[262] := FPWEB_GETCLOCK_DATETIME(); #32Bit result in seconds since 1.1.2001 (DDT)
END_IF;
#Function to get the current status of the Ethernet interface
#Please consider the DDT register and the address index!
DDT[280] := FPWEB_GET_IP4("ETH0", "ADDRESS");
DDT[282] := FPWEB_GET_IP4("ETH0", "NETMASK");
DDT[284] := FPWEB_GET_IP4("ETH0", "GATEWAY");
DDT[290] := FPWEB_GET_IP4("ETH0", "STATUS");
FPWEB_SLEEP(1); #Wait a little bit (time in seconds)
#=================================================
#The following lines are just for information and
#for manually created FTP transmissions
#To configure the default FTP transmission please
#use the web interface / script settings.
#=================================================
#Syntax: FPWEB_FTP(FileFormat, Rename, FileSplit, BaseTime, SendCycle, MaxRepeatInCaseOfError)
FPWEB_FTP("DEFAULT_FORMAT",".CS_","DAY",0,120,3);