GooF Posted June 10, 2012 Report Posted June 10, 2012 hello, i'm new in programming omron. i think i know the basics. now i have a special problem. i want to great a function block with an input variable of type int. the input variable shall be the first word of a cio area. example: - the input variable is &3200 - in the function block i want to work with 3200, 3201, 3202 and 3203 (it is input adress +0, +1, +2 and +3) the problem is, i dont know how to do this with bits. extended example: - the input variable ist &3200 - in the function block i want to work with all bits of the word 3200 and the full word 3201, 3202 and 3203 (it is input adress +0, +1, +2 and +3) for the word i have several ways for indirect adressing: - working with ir and dr with an internal variable on adress 0 - an internal variable on adress 0 with array but i have no idea to address bits and words. is there a good solution? thanks (sorry for my bad english) Quote
GooF Posted June 12, 2012 Author Report Posted June 12, 2012 thanks. this works. i found a second solution by using a user data type. works fine. but there is a new question. now i want to define which memory area i want to use. example: - the first input variable defines the memory area (D, W, H, EM0, ...) - the second input variable defines the first word in the area (like the &3200 in the first example) in the function blocks of the omron lib, the variables are called AreaID and AreaNo. the AreaID is a number for a memory area. they use the standard symbols like P_CIO or P_EM0 for define the area. in the function block, the AreaID is compared with the Number of the standard symbols and if the compare is true, a IR is loaded with the first word of the memory area. sorry, i cant explain it in good words. short version: - a input variable AreaID, the parameter for Area_ID ist P_EM0 (P_EM0 is the symbol for A461, the value is #0050) - in the function block, the AreaID is compared with several values - if the AreaID is compared with #0050, compare ist true and the IR0 is loaded with the Pointer on EM0_0 - this compares exists for every memory area my question: is this the only way for define a memory area? Quote
VAU_RMA Posted June 21, 2012 Report Posted June 21, 2012 Hi, I answered to a similar question earlier, see link to topic. http://forums.mrplc.com/index.php?showtopic=20988&st=0&p=101206entry101206 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.