How to deal with arrays ?
-
Hello,
I have questions about arrays to pass to ST programs and FBD programs.- how to declare arrays on MervisIDE, such as MyVariables ARRAY[0..10] on INT ? I do not see any array related type in pull downs.
- according to my case, Mervis has specific array type of int, MultiIoInt data type. Are you supposed me to use this type when I want use array of integer ?
thank you.
-
Hello @ayone0518,
- You almost got it right. The definition is this:
VAR my_array: ARRAY[0..10] OF INT; my_prefilled_array: ARRAY[0..2] OF REAL := [ 1.123, 2.345, 3.456 ]; END_VAR- Since this is the first time I hear of this then no, use the standard ST definition :-)
Best regards,
Martin -
Thank you Martin.
I have one more question.
Can I declare array as local variable on Mervis FBD UI ?
It seems I can't do this on it. -
Hello @ayone0518,
no, the arrays cannot be defined in FBD.Best regards,
Martin
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login