03-18-2024 11:10 AM
I am trying to connect my array of com port locations into a Subvi but not sure why I keep getting this error. I am unfamiliar with the last line "type of the sink".
This is my cluster of arrays, the Fluke gauges is the array I am trying to connect into the Subvi.
Thanks,
03-18-2024 11:16 AM - edited 03-18-2024 11:16 AM
Can you show what is your subvi expecting ?
Make sure that the subvi input is the same type.
03-18-2024 11:20 AM
It is expecting a resource name, which I assumed my array was an array of resource names. I want to be able to keep the resource names in the array so I dont have to edit the code too much. It does work if I take them out of the cluster though and connect them individually.
03-18-2024 11:25 AM
if your sub vi is expecting a resource name and you are wiring an array of resource names that's the issue.
You need to specify with array element you want to pass on to the subvi.
If you want to repeat the same subvi to all elements of your resource array, then you need to add a "for loop" with your subvi inside then wire the resource name array and it will execute several iterations (the same number of your array elements) one at a time and will output an array of responses.
03-18-2024 11:27 AM
if that's a cluster of resource names you may need to use a cluster to array function.
03-18-2024 11:37 AM
I have done that and that problem looks solved, but it has cascaded into not being able to connect to the next part which is a DAQmx Read.
03-18-2024 11:50 AM - edited 03-18-2024 11:52 AM
Hi Gadel,
@The_Gadel wrote:
I have done that and that problem looks solved, but it has cascaded into not being able to connect to the next part which is a DAQmx Read.
Your subVI (which is unknown to us) outputs a scalar float value "Pressure".
The loop creates an array of floats (aka "Pressures").
And you wire this array of float pressures to a DAQmx function, that is expecting a DAQmx resource. Do you see the error (now)?
03-18-2024 11:55 AM
You have readings from COM ports being used as DAQmx tasks. Where are you supposed to get the second DAQmx task? Or a better question would be what are you supposed to do with the data from the Comm Main?
03-18-2024 12:18 PM
i think you are wiring an array of double numbers to the resource of DAQMX.
03-18-2024 01:44 PM
I think its worth mentioning that I am a beginner who has been given a prewritten code. I am tasked to learning it and making some edits to it to work for another test setup. What I am doing here is replacing the NI-9203 card on the chassis (which was going to read the pressures) and replacing it with a subvi that will read the pressure gauges via USB. Realized that the DAQmx is not needed since I am not using a card anymore. My original question has kind of been solved with this method.
Did not realize I had to index the array to get the separate functions rather than unbundling like a cluster. I am now working through how to connect it to my front panel cluster of gauges.
At this point I just need to troubleshoot more. Appreciate all the insight!