Array Basics?


kedi

Recommended Posts

First post.

I find the Guide to be very sparse on array information. I need the basics.

How to create a 4 x 72 array named channels. ( I think I know this much ) How to insert a value read from a channel into that array. ( channels(3,62)=channel62 for instance ?) How to reference a value in the array to display in a table. (Expression in the table component ( channel(3,62)?)

Right now I don't know the different formats to access the array. Creating, inputting to it, reading from it.

 

Link to comment
Share on other sites

Everything is done with [] bracket notation, so, for example to access element 3,62 you would do channels[3][62].  The array is created dynamically as you reference it.  So to create a 4x72 array, you would just give element 3,71 a value and DAQFactory will fill in the rest with 0 or blanks: channels[3][71] = "abc".  Note that indexing is all from 0, so [0][0] is the first element.  This is all described in 4.5 and 4.6 of the user's guide.

 

 

Link to comment
Share on other sites

I am not familiar with how dynamic the array system is here. Been a long time since I did anything with arrays at all. More hardware than software for quite some time now. Needed some info to edit a running system that I built and coded a few years ago. Constrained by time and having the system always running. Will investigate the array scheme separately.

Thanks for the reply.

Link to comment
Share on other sites

You might download a trial so that you can play (for 25 days at least) offline on your own PC.  You could then run Express if you wanted to play further.  Express probably won't run your full app, but at least it would allow you to experiment with arrays and other functions in DAQFactory.

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.