LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple slaves


@dotis10 wrote:

The outer loop is a For loop, so the "i" I use is from a For loop.
I am stuck in getting the two different data types (header+signal) into the Dynamic Attributes. I though putting them into an array first would let me send it into Dynamic Attributes.



I managed to input headers but they all end up in one column.. Smiley Frustrated

0 Kudos
Message 21 of 41
(1,530 Views)

See the attached modification.  It incorporates exactly what I was talking about.

I never said anything about building a cluster of arrays so I don't know why you did that.

Be sure to put 4 elements in your header array.

 

Please be sure to take the LabVIEW tutorials.  And definitely read the help file on functions you aren't familiar with.  It feels like you know what functions are there in LabVIEW, but don't really understand them and are just throwing something on the block diagram hoping they'll stick.

0 Kudos
Message 22 of 41
(1,528 Views)

@RavensFan wrote:

See the attached modification.  It incorporates exactly what I was talking about.

I never said anything about building a cluster of arrays so I don't know why you did that.

Be sure to put 4 elements in your header array.

 

Please be sure to take the LabVIEW tutorials.  And definitely read the help file on functions you aren't familiar with.  It feels like you know what functions are there in LabVIEW, but don't really understand them and are just throwing something on the block diagram hoping they'll stick.


Thank you!
Do you mind uploading an older version of the VI. I have v2016 and cant open the file.

0 Kudos
Message 23 of 41
(1,523 Views)

Sure.  I hadn't noticed it was an older version.  Here you go.

 

 

0 Kudos
Message 24 of 41
(1,519 Views)

Thanks a lot! 

For the Time stamp - is there a way to get around the non-existing time data and get a relative time stamp? Like using the sampling rate/timer value, 1000ms? Or subtracting the default time stamp (1904-01-01 00:00:00) and the time added to it? 

0 Kudos
Message 25 of 41
(1,513 Views)

I am adding a Write-function in a case structure. Some of the registers are split up into two or three, like this:

 

write_reg.PNG

 

 

 

Where reg. 36 sets the unit by writing a certain number (2-14). How do I handle the divided write register?

 

0 Kudos
Message 26 of 41
(1,500 Views)

That table doesn't make any sense.  It has 3 rows, talks about 2 bytes, and all say "36".

 

IF this is a single register, look at the Numeric >> Data Manipulation palette.  All the functions are there and you've already used some of them.

0 Kudos
Message 27 of 41
(1,495 Views)

@RavensFan wrote:

That table doesn't make any sense.  It has 3 rows, talks about 2 bytes, and all say "36".

 

IF this is a single register, look at the Numeric >> Data Manipulation palette.  All the functions are there and you've already used some of them.


Yeah, that makes me confused.. The manual says it is "Write Holding Registers".

0 Kudos
Message 28 of 41
(1,491 Views)

Right now I have a case structure that writes to a register when a button is pressed.

I want to be able to write to all slaves that I read to (to be able to digitally calibrate the sensors and set the same unit on them). So the Write function will not be used that often..

 

Is it Ok to have a Write and Read function in the same VI? Or should I have the write function in a separate VI or use a "read/write" case if using them in the same VI?

 

As for the confusing Write register (Holding reg. = multiple reg??) - I guess it is just the high and low byte I will write to, where high = 0x01 and low=the specific number for the corresponding unit? 

0 Kudos
Message 29 of 41
(1,471 Views)

Yes.  You can do reads and writes in the same VI.

0 Kudos
Message 30 of 41
(1,414 Views)