Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

serial data missing in multiple port operation

Solved!
Go to solution
0 Kudos
Message 11 of 14
(965 Views)
Solution
Accepted by topic author rg.naveen

I started to reply earlier but the Forums were shut down for maintenance.

 

I prefer to keep the discussions here so that others may benefit from anything learned.

 

Your block diagram is huge! The style guides recommend keeping the size of the diagram to one screen.  This makes it much easier to see what the program is doing.

 

If your devices are not sending a termination character, disable the termination character in the configuration VI.  Then just read the number of bytes being sent.  Iy looks like your data starts with 55 and ends with CC.  If CC is never allowed to occur in the data, use CC as the termination character.  If you run without termination character, you will need to identify the frames as 51 character strings starting with 55 and ending with CC.  Because your reads may not be synchronized with the frames, you need to do some extra buffering with a shift register.

 

The main problem you have is that you are building arrays in a while loop.  Because LabVIEW does not know in advance how many iterations the loop will run, it cannot pre-allocate memory for the arrays.  As the arrays grow new space must be allocated.  Arrays are stored in contiguous memory locations. After numerous allocations the memory may be sufficiently fragmented that it is no longer possible to allocate a new space big enough for the relay.  At that point the program will fail.  It should throw an error, but crashes are possible.

 

Although it has nothing to do with the program hanging, why are you wiring True constants to dozens of Selector functions? Perhaps this was something you simplified for the tests?

 

It appears that a few of the bytes in each frame are not used and at least one was used twice.

 

Lynn

Message 12 of 14
(947 Views)

THANK YOU SO MUCH..See you were right building arrays was the main issue which was against my expectation of result.... As per our solution I removed all array building functions in my code and have made it to write directly to the harddisk as a text file, and the continuous receiving data is just monitored by the sub vi which I've made and a string display to monitor the frame received at that moment. as an experiment , I operated on two channels with out building any array inside the loop and my program executed for bat 3Hrs with out any signs of obstacles...And lynn as I'm new to lab view I have made this code very huge I guess,I myself notice that..Can u suggest where else I can still make it simplifier (if needed)And the purpose I have use true select function is because that byte will have value either FFor 0F so I had planned that way n designed.. Is that a wrong way to do? I accept and learn wat you suggest..Thank you

 

 

naveen

0 Kudos
Message 13 of 14
(935 Views)

Instead of using all of those separate Index Array functions, use one and drag it down. No need to wire inputs. The first output is index 0, second output is index 1, etc.

 

Your logic is flawed. If in fact the byte can be just one or another, a single equal comparison wired directly to the Boolean indicator is enough.

 

p.s. I don't think your checksum VI is at all correct.

Message 14 of 14
(930 Views)