06-20-2011 09:41 AM
I am new to fieldpoint and have my block diagram set-up to read 8 strain gauges using an SG-140 module. My backplane is filled with 8 SG-140 strain gauge modules, and I need to know how to fix my block diagram to read all 8 SG-140 modules. So, I need a total of 64 strain gauge readings using 8 SG-140 modules. Can I do this without actually copying what I already have done 8 more times? Is there a way to use a loop or something to make it read the other 7 modules? I appreciate any help I can get.
Solved! Go to Solution.
06-20-2011 10:29 AM - edited 06-20-2011 10:32 AM
You will need to do 8 reads. But you can do it in a loop. Create an array of your fieldpoint I/O channels, one for each module. Then feed that into a For Loop with autoindexing turned on that wraps up a Fieldpoint read. The output of the loop (also autoindexed) will be a 2-D array where 1 dimension represents the different modules, and the other dimension represents a different channel on each module.
By the way, you don't need to copy the Index array function to get different elements of the same array. If you drag the border of index array downwards, you get more outputs. You can than wire your 1, 4, and 7 constants to each element index input.
06-20-2011 02:03 PM
How do you create an array of your fieldpoint I/O channels? I have tried to accomplish it and research it and have not been able to come up with anything. I am attaching my project again with the changes. After I made the for loop, I now the following message:
These cannot be wired together because their data types (numeric, string, array, cluster, etc.) do not match. Show the Context Help window to see what data type is required. The type of the source is 1-D array of double [64-bit real (~15 digit precision)]. The type of the sink is double [64-bit real (~15 digit precision)].
I am not sure if this is because I have not created the array for the fieldpoint, but I am assuming it is not and that I have done something else wrong.
Also, I have the project set-up to read out to a spreadsheet. Will it read out all 64 channels at the same time so I get one set of data?
Thanks for the information on the index array. I fixed it. You probably can tell, I do not have much experience with Labview but I have looked at tutorial and taken the 6 hour getting started and read a lot of postings.
06-20-2011 02:05 PM
Sorry I forgot my attachment.
06-20-2011 02:15 PM
Drop an array container onto the block diagram, then drop the Fieldpoint I/O inside of that.
Since the loop creates a 2-D array, indexing the array gives you 1-D arrays, thus the error.
You need to index by row and column to go from a 2-D array to a scalar element. Alternatively, you might want to reshape the 2-D array to a 1-D array.
I still don't understand why you are splitting the array into 3 parts, and then grabbing the same rows (or columns) 1, 4, 7. I would just index the array once, and split the wires for rows 1, 4, and 7 afterwards.
06-20-2011 04:31 PM
It is being split into three parts because there are three rosette strain gauges on each SG-140 module. Each rosette has three reading (each one reads in a different direction). Currently all each index array represents one rosette strain gauge. If I do not have to split into three index arrays, I will not. Can I use one index array to read all eight reading off one SG-140 module for three different strain gauges?
I am still not sure how to index by row and column to go from a 2-D array to a scalar element or shape the 2-D array to a 1-D array.
I reattached the project because I made one correction.
Sorry and thanks for your help.
06-20-2011 08:21 PM
My comments about not needing to duplicate the index array were based on what your VI was showing at that time. Once you have the VI implemented with the multiple modules, then you will need to implement a single Index Array stretched out far enough to get all of the channels of interest. From a 2-D array, you need to wire up both the row index and the column index to get a single scalar element. So first channel would be 0 and 1, next channel 0 and 4, next 0 and 7. The next module would be 1 and 1, 1 and 4, 1 and 7.
07-04-2013 06:22 AM
hey
i use the script matlab when i connect a output of Script Node to input of other Script Node i get this message error :
These cannot be wired together because their data types (numeric, string, array, cluster, etc.) do not match. Show the Context Help window to see what data type is required.
The type of the source is 1-D array of
double [64-bit real (~15 digit precision)].
The type of the sink is double [64-bit real (~15 digit precision)].
Please how can i conevert 1-D array of double to a double ?
07-04-2013 01:11 PM
You should have started a new message thread rather than jumping on to a 2 year old thread.
You need to use Index Array to get a particular element out of an array. If you still need help, please start a new message thread. But first I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
since working with arrays is a basic LabVIEW skill.