LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication missing bytes

Hi Archie C,

               Try using VISA Read n Wirte in an seperate While Loop which may be an better option to read, Give th emaximum bytes in the byte count that will help you in solving the issue.

0 Kudos
Message 21 of 62
(553 Views)

Hello gnshmrthy,

                          Can you tell me how writing VISA read and write in two different while loop will help.

 

What do you mean by maximum bytes ?

--------------------------------------------------------------------------------------------------------
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 22 of 62
(547 Views)

Friends, Ranjeet and gnshmrthy,

 

I am using Visa read and write in two separate while loops.
Smiley Happy

0 Kudos
Message 23 of 62
(544 Views)

Please check the Image which might give you what I was trying to say.

0 Kudos
Message 24 of 62
(542 Views)

While we write the data in a seperate while loop with specified delay and the loop only waits for he writing the VISA not for Reading the VISA this will help in removing the Missing bytes in the serial communication. In read VISA even if it takes more time for the tester to respond it will wait and read the complete data and data doesn`t miss. Hope this cleared the concept.

0 Kudos
Message 25 of 62
(540 Views)

Hi ArchieC,

                 Dont ever try to write the code in this way, This is very bad code (Sorry to say that)

 

If you write like this then both the while loop will try to access same COM port simultanously(may) which is wrong approach as it will never work. Here you can say that this is serial communication as you cant determine the squence of operation.

 

One more thing this is serial communication hence one should follow the rules first write then read or vice versa. Have you ever saw any serial communication code using your method.

 

And you are trying to open the VISA which is already open continously as fast as possible as there is no delay inside while loop and in both the while loop you are using VISA open . May god save you.

--------------------------------------------------------------------------------------------------------
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 26 of 62
(540 Views)

Do your operation serially not parallely as this is serial communcation

 

--------------------------------------------------------------------------------------------------------
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 27 of 62
(535 Views)

And why number of byte read is 0 ? 

--------------------------------------------------------------------------------------------------------
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 28 of 62
(534 Views)

Hi Archie C and friends ,

                                    If you find this the correct mark the solution.

0 Kudos
Message 29 of 62
(519 Views)

Hi Ranjeet Singh,

                        You should make the open and close outside the Loop  which is an bug here in my image, so if you make it connecting it with shift register it would work. My point is since there is an delay and other function need to be processed in seperate while loop which will trouble the data read and writing the data. The 0 is nothing but you can enter the no of bytes of data which needs to be read. I made it zero in order to alow the programmer to enter the appropriate bytes of data.

0 Kudos
Message 30 of 62
(517 Views)