Jump to content

Recommended Posts

Posted

I want to create an Array or a Structure in the NJ that I can access in the NA5 as BOOL and as DWORD. The easy answer is to create a UNION. I tried this and cannot access a BOOL[x] element from the NA5. Am I missing some simple syntax or is this not possible?

An alternative solution was to use a Structure, which works well in the NA5 for accessing members but I cannot compare the Structure to a value.  So now I'm trying to break it out using the ToAryByte function. I read in a previous post that it works. (There were no details). Below is the error I receive. The G_Traverse_01_Faults is a 'Fault' Structure shown below. I haven't though about where I would go from here but I can't get passed step 1. The instruction reference states the 'In' will accept a Structure or Structure member. I've over thought this to point where I am clueless. Is it possible to convert my Structure to a comparable number?

MrPLC_Question_01.thumb.jpg.d0ed7283be24

 

MrPLC_Question_02.thumb.jpg.d67fb967328b

Posted

That's great advice because I did forget. The moment I read your post, I had remembered reading that in a previous post. This solved my Array issue which I'll probably use over the Structure.

For my reference, I would still like to know why I can't get the example (pictured above) to work.

Thanks for the reminder, Crossbow!

 

Posted
10 hours ago, Crossbow said:

Don't forget in the HMI it's .NET rules, so the array index is in parentheses not square brackets.  Not sure if that helps or not...

Just to be extremely picky, this is not a .NET rule per se, but a VB rule. C# uses square brackets.

It's a pity (IMHO) that the NA screen cannot use C# as the macro language as well as VB, but that's just my preference.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...