jpo Posted October 7, 2022 Report Share Posted October 7, 2022 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-- cDaq_Objects.zip Quote Link to comment
Bryan Posted October 7, 2022 Report Share Posted October 7, 2022 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. Quote Link to comment
Rolf Kalbermatter Posted November 11, 2022 Report Share Posted November 11, 2022 (edited) 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 November 11, 2022 by Rolf Kalbermatter Quote Link to comment
ShaunR Posted November 11, 2022 Report Share Posted November 11, 2022 Ditto what Rolf said. If you want a class that handles arrays of objects then take a look at List. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.