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,362 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,339 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,332 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,319 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,311 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,308 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.

 

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.


Would you care to elaborate it more...!!

 

I can see, you're succesfully able to segregate the instrument name and the data associated with that particular instrument, now as the associated data is in the form of CSV, you might want to use Spreadsheet String To Array function as demonstrated... I'm not if thats the solution to your problem..!!

 

Instrument data to Array

 

Edited: Inserted image (snippet) for illustration.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 7 of 9
(2,301 Views)

Dear Friend 

                        Actually I do..I am not able to understand the meaning of 'checking whole array value of that data'

--------------------------------------------------------------------------------------------------------
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 8 of 9
(2,276 Views)

Thanks Ranjeet_Singh and Moderator 1983 for helping

 

Sorry for the late reply,  I have found the solution to the problem

 

by checking whole array value of data i mean to say that since i have an array which contains list of all the instruments i want to program, after that using match regular expression i am separation name of the instrumetn and the data values corresponding to that instrumetn, for every instrument name i am having case structure which will exectite the data for that particular instrument now when i am running the program according to the array of instrumetn name program is executing every case structure corresponding to every instrument now suppose first instrument in my list is power supply it will go to the case structure of that particular power supply after that logically program should process the data corresponding to this power supply only, but whta is happening is it is instead of processing the data for only that power supply( i am having two araays one which contains all instrument name and ither which contains all data corresponding to every instrument) it is checking all data values corresponding to all instrument in the list which is gving unexpected result . 

 

 

 

0 Kudos
Message 9 of 9
(2,264 Views)