Jump to content

Get 8 channel data in 8 rows and store the data


Recommended Posts

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

Link to comment
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.

Link to comment

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

Link to comment

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

Link to comment
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..

image.png.635288480d3e08a7b1242d167c70d13b.png

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.

  • Like 2
Link to comment

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

Link to comment
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

  • Like 1
Link to comment

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

Link to comment
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.

Link to comment
  • 3 weeks later...

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.