problem with read data block scl

slentnight

Member
Join Date
Jan 2015
Location
moscow
Posts
7
Code:
FUNCTION_BLOCK FB283

VAR_INPUT
DB_number: BLOCK_DB;
add : int;
END_VAR

VAR_OUTPUT
out:INT;
END_VAR

VAR

end_var


BEGIN

out:=WORD_TO_INT(BLOCK_DB_TO_WORD(DB_number.DB[add]));


END_FUNCTION_BLOCK

20156b258b02-adbc-4acc-876c-a799681eca07.png


I create 1 DB1 , i wanna read data from two address 0.0 and 0.2 , but i can't , plz help me

đź“š
 
Last edited:
Better to state that your code will not compile. Try this instead:

Code:
FUNCTION_BLOCK FB283

VAR_INPUT
DB_number: BLOCK_DB;
add : int;
END_VAR

VAR_OUTPUT
out:INT;
END_VAR

BEGIN
out:=WORD_TO_INT(db_number.dw[add]);

END_FUNCTION_BLOCK
 
Last edited:

Similar Topics

I am working on a project, inside an AB CLX, I implemented the Modbus TCP Client AOI published on AB website, to interreact with a Modbus ASCII...
Replies
7
Views
3,559
I am starting up a new RTU using a L306ER with a 5069 -serial to a Serial radio using DF1 Radio Modem Protocol. I only used it for reading to get...
Replies
1
Views
1,452
I have a square wave being put into the Micro850 input channel 0. I have tried with counting the rising edges with code and with trying the high...
Replies
4
Views
1,911
Hi All, this is my first experience with the Siemens CP343-1 Profinet used as I/O Controller for manage ET200M remote I/O. Here my actual...
Replies
3
Views
2,881
Hey guys, I have one of the new CLICK plc from AD with an ethernet port on it. I made a subroutine for an IO Map of a modbus slave device I have...
Replies
11
Views
4,696
Back
Top Bottom