LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem in separating data and instrument name in a string

i am working on instrument automation project in which i am passing an array of some instrument list, which contains instrument name and the data to program the instrument, with the help of the match regular expression vi i am separating instrumetn name and the data in two arrays, for every instrument name i am having one case structure, in an array when that particular instrument comes program goes to that case structure, same way i want that in case of any particular instrumetn , it should process values corresponding to that one instrument only, i have tried several methods but none is giving the xpected result.

 

attached below is the vi 

0 Kudos
Message 1 of 9
(2,727 Views)

Give one example what is input and what is expected output.

Attach any sample for reference

 

Thanks

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 2 of 9
(2,704 Views)

e.g. in list of array in vi one instrument is 8741(GPIB::2::INSTR,40,4,False),

 

now in this list first with the help of match regular expression vi i am separating instrument name part( in this case 8741, anything written before bracket comes under instrument name) and data (i.e. address, voltage, current and other necessary controls to program the instrument) in second part, than for every different instrumetn name i am having separate case structure , in that case strucutre i have to process this data means i.e the values within the bracket to the driver , 

 

i am getting problem in data part, as you can see in my vi i have made the case structure for every different instrument i am working upon, now problem is that i want to sen the data e.g in case of 8741 i want to send the data corrsponding to 8741 i.e GPIB::2::INSTR,40,4,False only to process but what is happening since it is checking whole aray value of that data it is changing data value every time even if 8741 is not there in the list, i dont want this.

 

if i am doing this with for loop i.e if i am keping all the data values in every instrument case strucutre in for loop than although it is taking only that particular instrument value but instead of taking one by one in array it is taking all the values for 8741 that are present in array simultaneously.

0 Kudos
Message 3 of 9
(2,697 Views)

Hi ritu,

                  Actually I am busy with some other work and not able to read all the things Smiley Sad, I am attaching one VI let me know if it meets your requirement or what change you need

 

Thanks

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 4 of 9
(2,684 Views)

Hello Ranjeet, Thanks for the reply...

 

The vi that you have send i am also working the same way just instead of search\split string i am using match regular expression, i am also getting the same ouput, the problem that i am getting is executing data with the same corresponding instrument, once when you will get time, you can see the vi that i have attached, than you might get clear picture of where i am getting problem. Anyways you can see vi whenever you are free, and thanks again for the help

0 Kudos
Message 5 of 9
(2,676 Views)

 

@Ritu wrote:

 

i am getting problem in data part, as you can see in my vi i have made the case structure for every different instrument i am working upon, now problem is that i want to sen the data e.g in case of 8741 i want to send the data corrsponding to 8741 i.e GPIB::2::INSTR,40,4,False only to process but what is happening since it is checking whole aray value of that data it is changing data value every time even if 8741 is not there in the list, i dont want this.

 


Can you please elobrate this?

 

What is checking whole array value of that data means ?

 

Thanks

 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 6 of 9
(2,673 Views)