IO_Rack

NJ Array or Structure to NA5

4 posts in this topic

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

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

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!

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now