NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

how to "printf" from LabVIEW to console

Solved!
Go to solution

Is it possible to send strings to the console from LabVIEW?  Now that we have a monitor connection, sending strings to the console is a quick and easy debug technique.

I tried using the System Exec.vi with the echo command, but it did not work.

0 Kudos
Message 1 of 11
(9,286 Views)

The verdict at this time is still, no. I believe your request is covered on this idea exchange post.

http://forums.ni.com/t5/LabVIEW-Real-Time-Idea-Exchange/Add-console-to-Linux-based-cRIO/idi-p/287113...

Tim A.
Message 2 of 11
(7,807 Views)
Solution
Accepted by topic author kwkengineer

Maybe I'm missing something, but have you tried calling printf? It works great for me.

printf.png

Message 3 of 11
(7,807 Views)

@DAQjr that's what I was looking for.  Works great, one thing had me lost for a moment though, the newline at the end is required for output to the console.

0 Kudos
Message 4 of 11
(7,807 Views)

I get the feeling I'm missing something, but isn't this what RT Debug String is for? http://zone.ni.com/reference/en-XX/help/370622K-01/lvrtvihelp/rt_debug_strings/

(I just tried it and it did what I think you're asking for on both cRIO-9068 and cRIO-9030.)

0 Kudos
Message 5 of 11
(7,807 Views)

Right on.  I'm the one missing something...haha

I knew there was an easy way, just failed to look hard enough.

0 Kudos
Message 6 of 11
(7,807 Views)

My first comment is misleading. I misunderstood the original question. The idea exchange I pointed to was with regards to the the ability to view console outputs remotely over ethernet using Web Based configuration and monitoring. That functionality is supported for VxWorks and ETS but not for any of the Linux RT controllers. Sorry for the confusion there.

The RT Debug String function should provide the functionality you need. The only caveat I can think of is using an x64 Linux RT target with Embedded UI enabled. In that case, you can open terminal connections but they won't display print commands from the RT Debug String function.

Tim A.
0 Kudos
Message 7 of 11
(7,807 Views)

Hello

 

I know this thread is old, but how did you configure your call library function node. Can anyone tell here?

0 Kudos
Message 8 of 11
(5,318 Views)

I did it exactly like DAQjr on the block diagram, but there is still an error: Call Library function node: no function specified. What is missing in terms of configuration? 

0 Kudos
Message 9 of 11
(5,305 Views)

Can't work on my laptop, reported "Error 7 occurred at Call Library Function Node", "File path not found".

Labview2015 with Win11.

0 Kudos
Message 10 of 11
(3,307 Views)