LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to send different types of data periodically over Serial Port?

Solved!
Go to solution

@RavensFan wrote:

Put the Byte Array to String and VISA Write inside your subVI.  Everything about how to formulate a message and the actual writing of the message should be encapsulated in the subVI.

Done, now writing part is moved to Sub VI.

 

(Why'd you change Enable Termination Character from False to True?)

Oh, That's done mistakenly, now corrected.


Updated VI and SUB VI

 

VI.png

SubVI.PNG

0 Kudos
Message 11 of 31
(1,969 Views)

No No No.

 

You need to put a U8 bullet between the arrays size function and the Build Array.

 

(Remember what I said when you asked about all the red coercion dots?)

Message 12 of 31
(1,955 Views)

@RavensFan wrote:

No No No.

 

You need to put a U8 bullet between the arrays size function and the Build Array.

 

(Remember what I said when you asked about all the red coercion dots?)


Okay i will put that. Thanks for pointing this.

Rest of the things is okay ??

Any other suggestions??

0 Kudos
Message 13 of 31
(1,940 Views)

 

:

Yes, put the VISA Write inside of the case structure.  You just wire the VISA Resource straight through in the false case.

 

1. That usually happens when you change the connector pane of the subVI. ( Got it, i tried to change the connnector terminals that's why this happen)

2. That is completely based on the connector pane and where you wire up the controls. 

 


 

Thanks that works, and i modified the block diagram as per RavenFan and it is working properly.

 

 

0 Kudos
Message 14 of 31
(1,930 Views)

I created it in the form of Sub VI, which is as follow:

 

VI.png

 

 

Its working properly.

Now as i earlier mentioned that, i had already done the recption part and this is transmission part. Both are working fine individually.

But how to merge these both such that they both work without halting each other.

Like if place the Op Code Write Packet SubVi in the main loop, its execution is prevented due to Serial Read, i know LabVIEW only works when data is available at its terminal.

So canyone please suggest me how can i solve this issue.

 

VI.png

 

 

 

 

0 Kudos
Message 15 of 31
(1,908 Views)

 

I created it in the form of Sub VI, which is as follow:

 

VI.png

 

 

Its working properly.

Now as i earlier mentioned that, i had already done the recption part and this is transmission part. Both are working fine individually.

But how to merge these both such that they both work without halting each other.

Like if place the Op Code Write Packet SubVi in the main loop, its execution is prevented due to Serial Read, i know LabVIEW only works when data is available at its terminal.

So canyone please suggest me how can i solve this issue.

 

VI.png

 

 

 

 

0 Kudos
Message 16 of 31
(1,908 Views)

Your state machine loop won't run until after your first while loop runs.

 

You have a data dependency there because of the VISA and error wires going from the first loop to the second loop.

 

(Have you taken those tutorials yet?)

Message 17 of 31
(1,898 Views)
Yes it is not running due to data dependency.
How can i solve this???


Which tutorials you are taking about.
In parallel i am watching video tutorials on youtube and also reading LabVIEW for engineer book.
What else will help me, please tell and help me in solve this.
0 Kudos
Message 18 of 31
(1,885 Views)

You just let the two loops run in parallel.  Branch the VISA reference and the error wire coming from the Configure Serial Port.  Once branch goes to the receive loop, the other branch to the send loop.  You should use Merge Errors after the loops and then to the VISA Close to make sure the port is not closed until after both loops have stopped.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 19 of 31
(1,872 Views)

I did it like this way.

But still not working, write part not working.

 

Can you please check what is wrong.

I am also attaching my complete project.

Is there any good book from where i can read such things, right now i am reading book LabVIEW for engineers and following some of the channels on YouTube ti learn the LabVIEW.

 

VI.png

0 Kudos
Message 20 of 31
(1,860 Views)