First, i would like to wish everyone a happy new year!!
could someone explain me what this code is doing??
I will try to put as much info after the code what i think/assume it is doing, can someone correct me??
Thx
FUNCTION_BLOCK FB 1
TITLE =
VERSION : 0.1
VAR
iCount : INT ;
bFlasher : BOOL ;
bFlashEdge : BOOL ;
dwData : DWORD ;
END_VAR
VAR_TEMP
bFlash : BOOL ;
END_VAR
BEGIN
NETWORK
TITLE =
OPN DB 2; // opn DB2
L #iCount; // Load value Count "Integer"
+ 1; // Add 1
T #iCount; // transfer the sum of iCounter +1 to iCounter
TAR2 ; // Load the adress of iCounter to AR2 "0.0"
T #dwData; // transfer the adress of AR2 to dwData "0.0"
LAR1 P##iCount; // L iCount to AR1 or say LAR1 P#DIX0.0 WORD 1
A [AR1,P#1.3]; // And AR1+1.3 or 0.0+1.3 so makes A DIX1.3
FP #bFlashEdge; //Positief flank
JCN nofl; // Jump condition not to nofl
SET ; // set but what i don't know
S DIX 4.1; //Set Dix 4.3, so that would be second bit of dwData
R DIX 4.2; // reset dix 4.2, would be the 3 bit of dwData,
L #dwData; // Load the value of dwData, but what is in there exactly??
LAR1 ; // transfer the adress to AR1, Is this adress 4.0??
CAR ; // change ar1 and AR2, But what exactly is in AR1 and AR2??
CDB ; // change DI and shared db, so i think DB1 and DB2
AN #bFlasher; // Andnot bFlasher
= #bFlasher; // is bflasher
CDB ; // change DI and shared db, so i think DB1 and DB2
SET ; //??
R DIX 4.1; // reset bit 4.1, so again i think it is dwData second bit is reseted
S DIX 4.2; // 3th bit is set
L #dwData; // Load dwData, but what is exactly in there
LAR1 ; // transfer the adress to Dwdata
CAR ; // change AR1 and AR2, but what is in there?
nofl: NOP 0;
END_FUNCTION_BLOCK
could someone explain me what this code is doing??
I will try to put as much info after the code what i think/assume it is doing, can someone correct me??
Thx
FUNCTION_BLOCK FB 1
TITLE =
VERSION : 0.1
VAR
iCount : INT ;
bFlasher : BOOL ;
bFlashEdge : BOOL ;
dwData : DWORD ;
END_VAR
VAR_TEMP
bFlash : BOOL ;
END_VAR
BEGIN
NETWORK
TITLE =
OPN DB 2; // opn DB2
L #iCount; // Load value Count "Integer"
+ 1; // Add 1
T #iCount; // transfer the sum of iCounter +1 to iCounter
TAR2 ; // Load the adress of iCounter to AR2 "0.0"
T #dwData; // transfer the adress of AR2 to dwData "0.0"
LAR1 P##iCount; // L iCount to AR1 or say LAR1 P#DIX0.0 WORD 1
A [AR1,P#1.3]; // And AR1+1.3 or 0.0+1.3 so makes A DIX1.3
FP #bFlashEdge; //Positief flank
JCN nofl; // Jump condition not to nofl
SET ; // set but what i don't know
S DIX 4.1; //Set Dix 4.3, so that would be second bit of dwData
R DIX 4.2; // reset dix 4.2, would be the 3 bit of dwData,
L #dwData; // Load the value of dwData, but what is in there exactly??
LAR1 ; // transfer the adress to AR1, Is this adress 4.0??
CAR ; // change ar1 and AR2, But what exactly is in AR1 and AR2??
CDB ; // change DI and shared db, so i think DB1 and DB2
AN #bFlasher; // Andnot bFlasher
= #bFlasher; // is bflasher
CDB ; // change DI and shared db, so i think DB1 and DB2
SET ; //??
R DIX 4.1; // reset bit 4.1, so again i think it is dwData second bit is reseted
S DIX 4.2; // 3th bit is set
L #dwData; // Load dwData, but what is exactly in there
LAR1 ; // transfer the adress to Dwdata
CAR ; // change AR1 and AR2, but what is in there?
nofl: NOP 0;
END_FUNCTION_BLOCK