6/21/2022 10:25 AM | |
Joined: 4/12/2022 Last visit: 6/22/2022 Posts: 4 Rating: (0) |
Hi everyone, I am trying to do some indirect addressing of an FB block in Simatic manager Step 7, and I am struggling with masking out some statements if datatype is 1 word and if datatype is 2 words. Here is my code so far: VAR_INPUT PV : ANY ; //INT, WORD, DINT or REAL END_VAR VAR PV_Type : BYTE ; PV_Value_DINT : DINT ; PV_Value : REAL ; END_VAR VAR_TEMP NETWORK TITLE =Load value at PV input into PV_Value L P##PV; LAR1 ; L B [AR1,P#1.0]; T #PV_Temp_1.Datatype; L #PV_Temp_1.Datatype; L 6; <I ; L W [AR1,P#4.0]; T #PV_Temp_1.DBnumber; OPN DB [#PV_Temp_1.DBnumber]; L W [AR1,P#8.0]; T #PV_Temp_1.ByteAddr; L DBW [#PV_Temp_1.ByteAddr]; T #PV_Value_DINT; L #PV_Value_DINT; DTR ; T #PV_Value; END_FUNCTION_BLOCK What I want to now is to mask out if the datatype of the data at the ANY Input is a REAL. If it is a real I want to just put it directly into PV_Value without the conversion, however i cannot seem to get the syntax of the code right. can anyone please help? Thanks in advance //RUNE ------------------------------------------------------------------------------------------ |
Last edited by: Jen_Moderator at: 06/21/2022 12:41:48New subject after splitting |
|
6/21/2022 12:43 PM | |
Joined: 6/19/2017 Last visit: 9/6/2024 Posts: 8175 Rating: (172) |
Closed cause question posted twice. The second thread with the subject Indirect adressing with datatype recognition is published within the conference STEP 7 / STEP 7 Lite. Jen_Moderator |
Follow us on