LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

chnnostr in statblockcalc

Ok, I am not sure why this won't work.  I am trying to call StatBlockCalc and use channels that I select using the Chnget function.

This code works fine:

Call Chnget (3,0,channels)
chnnostr = "2-chnnomax"
Call StatBlockCalc("channel","1-10",chnnostr)

However, I would really like to use something like this:

Call Chnget (3,0,channels)
chnnostr = "chnno1, chnno2, chnnomax"
Call StatBlockCalc("channel","1-10",chnnostr)

Any tips?

Thanks, Tom

0 Kudos
Message 1 of 2
(2,002 Views)

Tom,

First of all, just a friendly reminder that if you post to the correct thread, you're much more likely to get the best answer quickly.  The DIAdem board can be found here

To address your question though. The problem with the statement chnnostr = "chnno1, chnno2, chnnomax", is that since chnno1, etc. are within quotes, they are being looked at literally as the string "chnno1" instead of the channel number itself, which is what you are looking for.  So, to fix that, all you have to do is concatenate your string like this:

Call Chnget (3,0,channels)
chnnostr = ChnNo1 & "," & ChnNo2 & "," & ChnNo3
Call StatBlockCalc("channel","1-10",chnnostr)

I tried this code on this side and it worked perfectly.  Let me know if you have any other questions.  Thanks and have a good one.

0 Kudos
Message 2 of 2
(1,986 Views)