Jump to content

Trouble creating an array of objects


Recommended Posts

I am trying to create a general purpose cDaq program.  It would be used for a variety of measurement types and would have an undefined number of channels.  I would like to use objects.

I am having trouble creating /grouping my objects together without out breaking wires.  Any ideas on what I am doing wrong?  Pics and project below.

Thanks

J--

image.png.4c5c6e7b6b63fcd88962b8cdf234c313.png

image.png.ee9639b2bfbe102d1b842fee138d8cb8.png

cDaq_Objects.zip

Link to comment

You are creating an array of objects, then trying to wire that array into a scalar input in your class methods.  An array of objects needs to be handled similar to any other array - you will need to index each object from your array in order to use/operate on them.

Link to comment
  • 1 month later...

You can either have those purple VIs use an explicit array of objects inputs and outputs on the upper corner. However then they are not a class method but simply VIs. Or you can create a new class that has as one of its private data elements the array of objects. Then instead of just appending the objects to the shift register array you call a method of that class to add the object to its internal object array. Then you can make your purple methods be part of that new object collection class. 

Edited by Rolf Kalbermatter
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.