Industry Automation and Control Forum
This forum is addressing industrial automation design & engineering, operations, asset performance, cyber security and digital transformation for Plants & Machines.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-10-22 03:12 AM
Hi everyone,
Do anyone know about the source code of a selector block in isagraf 3.35.The inbuilt selector block has integer as a input, but i want the input to be real, so I'm customizing a new block, but not sure how to write the source code .Can you guys help me out?
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-10-25 09:23 PM
The image you've attached shows the sel block to take 3 (THREE) inputs.
One Boolean (sel)
Two Integers (in1 and in2)
In called the two inputs as Input0 and Input1, which I think aligns better to the 'sel' input values... but you can call them what you want.
The output could be called output (as I did) or Q if you'd like (I generally consider Q to be a Boolean output..)
You shouldn't go down the path of C, it's too tricky for a function block in ISaGRAF. Stick with FBD or ST (which are both IEC61131-3 languages available in ISaGRAF).
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-10-24 12:02 PM
IF Sel THEN
Output := Input1;
ELSE
Output := Input0;
END_IF
Or do you mean you want the 'selector' to be a REAL?
I can't imagine what that would mean...
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-10-24 09:22 PM
Hi Bevan,
Sorry that you didn't understand the previous question. There is an inbuilt selector block in Isagraf which accepts only integer as its input, but i want the same selector block to get an input as a real value, since there is no such inbuilt block, I have to create a new block, so i did create it. But not sure about source code(which can be ladder, FBD, C), Source code means the way that the selector block had to perform the function. I have attached the selector block image for your reference.
Thanks,
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-10-25 09:23 PM
The image you've attached shows the sel block to take 3 (THREE) inputs.
One Boolean (sel)
Two Integers (in1 and in2)
In called the two inputs as Input0 and Input1, which I think aligns better to the 'sel' input values... but you can call them what you want.
The output could be called output (as I did) or Q if you'd like (I generally consider Q to be a Boolean output..)
You shouldn't go down the path of C, it's too tricky for a function block in ISaGRAF. Stick with FBD or ST (which are both IEC61131-3 languages available in ISaGRAF).
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.