intern0 Posted August 2, 2021 Report Share Posted August 2, 2021 I am currently working on a project where I have an Waterfeature8 instrument and and I have to get all 8 channels data. I want to get that 8 channels data comes in 8 rows continuously and record it or use it for graph and other purposes. As I am new using LabVIEW, I got to this point by getting help from another forum. Please guide me through this. Thanks Workingon.vi Industrial-monitoring-kit-wf8-datasheet.pdf Quote Link to comment
ShaunR Posted August 3, 2021 Report Share Posted August 3, 2021 On 8/2/2021 at 6:47 AM, intern0 said: I am currently working on a project where I have an Waterfeature8 instrument and and I have to get all 8 channels data. I want to get that 8 channels data comes in 8 rows continuously and record it or use it for graph and other purposes. As I am new using LabVIEW, I got to this point by getting help from another forum. Please guide me through this. Thanks Workingon.vi 44.63 kB · 2 downloads Industrial-monitoring-kit-wf8-datasheet.pdf 2.54 MB · 0 downloads Quote WF8readall :: Performs one complete polling cycle by sending the EZO r command to each populated socket. Note that this does not send the temperature compensated read command rt,n to the EZO circuit, although if there are any previously stored temperature readings in the EZO the reading will be temperature compensated by default. The return string format is {CH#EZOvvvv}[CR] after each socket reading. This command update 4-20 mA output values for each channel. Not sure where you are getting the format "Channel" and "=" from but if you are using the above command to get all readings then it clearly states the format is "CH#EZOvvvv". To save line-by-line then, once decoded, just pass a 1D array of values to the 1D array terminal of "Write to Delimited Spreadsheet" with the "Append?" set to true. Quote Link to comment
intern0 Posted August 5, 2021 Author Report Share Posted August 5, 2021 I am using WFdebug then getting data from that device. After debug the values come as follows Channel 01 Converting RTD sensor InBuff= 476.449 Converted hex value to AD420 = FFC5 Channel 02 Converting RTD sensor InBuff= -1809.400 Converted hex value to AD420 = 5BEF Channel 03 Converting RTD sensor InBuff= -1809.400 Converted hex value to AD420 = 5BEF Channel 04 Converting RTD sensor InBuff= -1809.400 Converted hex value to AD420 = 5BEF Channel 05 Converting pH sensor InBuff= 0.000 Converted hex value to AD420 = 0000 Channel 06 Converting pH sensor InBuff= 0.000 Converted hex value to AD420 = 0000 Channel 07 Converting pH sensor InBuff= 0.000 Converted hex value to AD420 = 0000 Channel 08 Converting pH sensor InBuff= 1.813 Converted hex value to AD420 = 2126 [8A Channel 01 Converting RTD sensor InBuff= 476.499 Converted hex value to AD420 = FFC5 so on. After I connect it with Write to Delimited Spreadsheet following message come up 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 double [64-bit real (~15 digit precision)]. The type of the sink is 1D array of double [64-bit real (~15 digit precision)]. Thanks Quote Link to comment
intern0 Posted August 5, 2021 Author Report Share Posted August 5, 2021 Thank you but I am getting nothing at all. I would to mention that "In Place Element Structure" is not working by itself. One expert recommend me to use this and told me "You need to define the array constant with the appropriate number of elements for all channels. That snippet is just a sketch (it's not meant as "reliable working code")!" I am stuck here for 4 days and can not make it working. If you could help me, I would appreciate that. Thank you. After parsing the value I usually get the values as follows for your reference Value1 Value2 Value3 Value4 Value5 Value6 Value7 Value8 Value1 so on My Latest VI Workingon.vi Quote Link to comment
ShaunR Posted August 5, 2021 Report Share Posted August 5, 2021 39 minutes ago, intern0 said: I would to mention that "In Place Element Structure" is not working by itself. One expert recommend me to use this and told me "You need to define the array constant with the appropriate number of elements for all channels. Your expert is correct. You must seed the channel array with as many items as you expect to index with the index array otherwise there is nothing to index into. You can define the array constant with as many channels you are expecting or you can do the following which will enable you to arbitrarily create a number of channels of your choosing.. You seem to be struggling with basic LabVIEW structures and functions. I would suggest you read and watch some online learning materials - especially around arrays and clusters - or maybe consider a LabVIEW course. 2 Quote Link to comment
intern0 Posted August 5, 2021 Author Report Share Posted August 5, 2021 Hi, Thank you. I am new in learning LabVIEW (Self learning). I study more in future but my project due tomorrow. I have changed according to your instruction but still nothing from the array (Channel) nor getting anything from Write Delimited Spreadsheet VI . I have set channel to different values. This my latest VI. Workingon.vi Quote Link to comment
intern0 Posted August 5, 2021 Author Report Share Posted August 5, 2021 If I can store those values and get graph from the 8 channels separately, I would be happy. Please help me finish this. Thank. I am willing to adapt new way if required and cant be done within a day. Thank you again. Quote Link to comment
ShaunR Posted August 5, 2021 Report Share Posted August 5, 2021 1 hour ago, intern0 said: Hi, Thank you. I am new in learning LabVIEW (Self learning). I study more in future but my project due tomorrow. I have changed according to your instruction but still nothing from the array (Channel) nor getting anything from Write Delimited Spreadsheet VI . I have set channel to different values. This my latest VI. Workingon.vi 50.09 kB · 1 download If the samples array is empty then you are probably getting an error before or at the Scan from String -the error out of which you have wired to the case structure. You will need to debug and figure out why that error is occurring. I would suggest you make the decoding part of your VI a sub-vi. This will enable you to check the string decoding after the serial reads in isolation to receiving a response from the instrument. In doing this, you can paste in the strings you supplied earlier and check that the correct array is updated. I have done this for you below. It fixes a couple of issues with the Channels array not being passed through the false case and indexing the array from zero when channels begin from 1. Decode.vi 1 Quote Link to comment
intern0 Posted August 5, 2021 Author Report Share Posted August 5, 2021 Thank so much for your time. I don’t have access to LabVIEW now. I will check this and will update you. Hopefully it will work or I don’t know what I will do. Thank you again Quote Link to comment
intern0 Posted August 6, 2021 Author Report Share Posted August 6, 2021 Thank you so for your work. The code works fine now but when I get the data in the file it comes like Value1 0.000 0.000 0.000 0.000 0.000 0.000 0.000 From txt: 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 -1809.400 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 -1809.400 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 -1809.400 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 126.856 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 -1809.400 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 -1809.400 0.000 0.000 0.000 0.000 0.000 For that reason I can not draw a graph form a single channel as it gives a value 0 when not reading the channel value. Is it also possible to get the value as: Value1 Value2 Value1 Value3 Value4 Value5 Value5 Value7 Value8 and draw sperate graph from each channel? Thank again for your time. I am truly grateful to you. With decoded.vi Quote Link to comment
intern0 Posted August 6, 2021 Author Report Share Posted August 6, 2021 I can extract the channel value separately and delete all the 0 from the array this way I can get the graph and value from its not efficient way to do it. That's why looking for better solution. Quote Link to comment
ShaunR Posted August 6, 2021 Report Share Posted August 6, 2021 7 hours ago, intern0 said: Thank you so for your work. The code works fine now but when I get the data in the file it comes like Value1 0.000 0.000 0.000 0.000 0.000 0.000 0.000 From txt: 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 -1809.400 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 -1809.400 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 -1809.400 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 126.856 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 -1809.400 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 -1809.400 0.000 0.000 0.000 0.000 0.000 For that reason I can not draw a graph form a single channel as it gives a value 0 when not reading the channel value. Is it also possible to get the value as: Value1 Value2 Value1 Value3 Value4 Value5 Value5 Value7 Value8 and draw sperate graph from each channel? Thank again for your time. I am truly grateful to you. With decoded.vi 52.63 kB · 1 download You will have to figure out why you are getting 0's in the reading. One thing I will say though. Right click on the serial read and write and set them to "Synchronous". Asynchronous reading is a much more complicated use case and you will struggle with the consequences while learning. Quote Link to comment
intern0 Posted August 6, 2021 Author Report Share Posted August 6, 2021 Thank you so much for all of your help. I will try to fix the problem of getting 0. Any hint why that might be happening? Quote Link to comment
intern0 Posted August 9, 2021 Author Report Share Posted August 9, 2021 Thanks to you, I have managed to finish it somehow. However, I am still not sure why I am getting those 0’s. Is there a way to get the time stamps as well to that write to spreadsheet file? Thank you. Quote Link to comment
GerdW Posted August 30, 2021 Report Share Posted August 30, 2021 Hi Intern, your "expert" needs to link to your crosspost in the NI LabVIEW forum… 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.