 codas
		
			codas
		
		
		
		
		
		
		
		
	
			08-13-2004 03:46 AM
 alipio
		
			alipio
		
		
		
		
		
		
		
		
	
			08-13-2004 04:29 AM
 Wiebe@CARYA
		
			Wiebe@CARYA
		
		
		
		
		
		
		
		
	
			08-13-2004 06:40 AM
 markmarty
		
			markmarty
		
		
		
		
		
		
		
		
	
			06-06-2017 02:09 AM
Hi alipio,
I have same question. I do find tasklist is useful, but i don't know how to pass the PID value to a variable so that i can locate the particular process from several processes that have same name. I'm using LV 6.0. Is there any function that LV provide can pass the PID value to a variable? Thanks a lot!
 rolfk
		
			rolfk
		
		
		 
		
		
		
		
		
	
			06-06-2017 06:22 AM - edited 06-06-2017 06:22 AM
What about the post from Wiebe doesn't help you? He showed the Windows APIs to call to get what the title of the post describes. Even LabVIEW 6 has a Call Library Node that can call those Windows APIs.
But from the sound of it you may actually have a different problem and then you should not attach your post to an existing only very loosely related thread, and it is also not very useful to resurrect a 13 year old thread anyways.
 matumot
		
			matumot
		
		
		
		
		
		
		
		
	
			02-25-2022 05:06 PM - edited 02-25-2022 05:10 PM
Hello, I could get process id with LabVIEW VI (2021 SP1) at Windows.
I input command in System Exec.vi
- tasklist /FI "ImageName eq LabVIEW.exe" /FI "Status eq Running" /FO LIST
Then I used two VI's for regular expression.
- PID:.*\d+
- \d+
I also attached figure of block diagram.
Is this good way to get process id?
 JÞB
		
			JÞB
		
		
		
		
		
		
		
		
	
			02-26-2022 06:06 AM
@matumot wrote:
Hello, I could get process id with LabVIEW VI (2021 SP1) at Windows.
I input command in System Exec.vi
- tasklist /FI "ImageName eq LabVIEW.exe" /FI "Status eq Running" /FO LIST
Then I used two VI's for regular expression.
- PID:.*\d+
- \d+
I also attached figure of block diagram.
Is this good way to get process id?
I am unsure what you are asking. If you have a specific question about the snippet you attached you should create a new thread. That would make it much easier for everyone to help you. You seem to have mistakenly replied to a thread that started 17 1/2 years ago.
LabVIEW, Computer processers and Operating systems have evolved dramatically over those last decades! In fact, the Original Poster hasn't even logged into these forums for over 12 years! So, it's unlikely your example will help codas.
(Besides snippets in 2020 won't open in 6.i for SO many reasons)
I could split this thread or you might just add a link to your new thread if you have a specific problem.
 matumot
		
			matumot
		
		
		
		
		
		
		
		
	
			02-26-2022 11:15 AM - edited 02-26-2022 12:09 PM
ok, my answer may be just a reply to first question, and mistakenly replied as you suggested. (my solution is very simple and may be adopted for labview with older verion, though I know labview is now targeted for subscription usage)
> Is there a way to get the 'process id' in LV?
 rolfk
		
			rolfk
		
		
		 
		
		
		
		
		
	
			02-26-2022 12:55 PM
One thing you need to watch out when using command lind tools is the fact that they are usually localized. This means that the output they generate can significantly differ depending on the country setting of the Windows installation or even currently logged in user. That can make parsing more complicated if it ever gets executed on a different system.
 matumot
		
			matumot
		
		
		
		
		
		
		
		
	
			02-26-2022 05:59 PM
I tested my code in japanese windows10 system, and it was ok.
But your indication can be correct.
> That can make parsing more complicated if it ever gets executed on a different system.