01-23-2020 05:01 AM
Hello,
I have a question. Is it possible to create User Interface VI on PC, which is by network shared variables connected with a VI on cRIO (which controls hardware), and then to enable that hardware activates only when I change some control value within UI VI, without opening cRIO VI at the same time?
I hope that I was clear.
Thank you for your answer 🙂
			
    
	
		
		
		01-23-2020
	
		
		07:25 AM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 - last edited on 
    
	
		
		
		04-14-2025
	
		
		03:19 PM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 by 
				
		
		
			Content Cleaner
		
		
		
		
		
		
		
		
	
			
		
I (used to) do it all the time. You just create an application that runs on the cRIO and deploy it. Then the application is running whenever the cRIO is turned on. You can then use a VI in LabVIEW or build an executable that can communicate with the cRIO application via TCP/IP, UDP, or Network Streams. Yes, Network Shared Variables do work, but I personally think they are 99% evil. I have just had soooooooo many issues with them (weird race conditions, slow updates, security of the data). So I highly recommend creating a messaging protocol and use TCP or Network Streams to send data back and forth. What I use is the STM library with a TCP connection.
01-23-2020 09:16 AM
Thank you for the answer.
I started with variables, and I am still learning, I will probably switch to some other method later.
I just have one more question. I have created a network shared variable, but the command which I give in User Interface VI (for example change in value of control button) doesn't change the state of LED connected with digital output for which I created the variable if I don't start both VIs (UI and cRIO RT VI) at the same time.
Can you possibly assume where is the problem?
Thank you, once again.
01-23-2020 09:35 AM
Another reason I hate NPSVs...
One of the targets has to host the variables. That should be the cRIO. So make sure you deploy the variables on the cRIO before starting your VIs.
01-23-2020 09:40 AM
I have deployed them on cRIO, and deployed them in library once again, and when I look at my NI system manager, the value of the variable changes, but the hardware doesn't respond, and the LED is off if only User Interface is active.
When I run both VIs at the same time, one on cRIO, and the other on my PC, the value of the variables also changes, but this time the signal is transferred to Digital output, and the LED is on. 😄