LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Any change in code causes data to change from good to bad

I have a vi that receives its data from a UDP stream.  A C# created dll is used as a stream file (order of data, and size (char, short, Long, and Double))

 

The issue is this: if I change any part of the code and then run the vi, the data that used to show good (ex 28 volts) becomes bad (ex 15154898762 volts).

I have played around with rebuilding the .dll, but I can't get a solid way to remedy this problem.  It seems to have worked sometimes, and not others, but I have been stuck with the bad data version for the past 2 hours.

 

I am not able to post my code.

I have searched and have not come across any situation like this.

I am new to posting here so please forgive me if I have omitted any helpful data.

Thanks.

0 Kudos
Message 1 of 6
(2,554 Views)

@bomluuk wrote:

I have a vi that receives its data from a UDP stream.  A C# created dll is used as a stream file (order of data, and size (char, short, Long, and Double))

 

The issue is this: if I change any part of the code and then run the vi, the data that used to show good (ex 28 volts) becomes bad (ex 15154898762 volts).

I have played around with rebuilding the .dll, but I can't get a solid way to remedy this problem.  It seems to have worked sometimes, and not others, but I have been stuck with the bad data version for the past 2 hours.

 

I am not able to post my code.

I have searched and have not come across any situation like this.

I am new to posting here so please forgive me if I have omitted any helpful data.

Thanks.


I'm guessing you have serious race issues with your VI and every time it recompiles, you roll the dice and maybe it works, maybe it doesn't.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 6
(2,540 Views)

OK, First, why are you using a C# DLL to write a file?  LabVIEW writes files very well.

 

Without your code we can only guess (As Bill has demonstrated)  Guessing without the 8-Ball in my cube does not often solve issues.

 

So, What did you change to make the data bad?  Cluster Order? a coersion?  any example code to help us reproduce this would help us help you.

 

What is the data type of "28"?


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 6
(2,530 Views)

 

I'm guessing you have serious race issues with your VI and every time it recompiles, you roll the dice and maybe it works, maybe it doesn't.


 

 

Ok.  I'll look into that.

0 Kudos
Message 4 of 6
(2,495 Views)

OK, First, why are you using a C# DLL to write a file?  LabVIEW writes files very well.

 

Without your code we can only guess (As Bill has demonstrated)  Guessing without the 8-Ball in my cube does not often solve issues.

 

So, What did you change to make the data bad?  Cluster Order? a coersion?  any example code to help us reproduce this would help us help you.

 

What is the data type of "28"?

 


 

The C# DLL is created before hand.  It is what creates the Property node (i think that's the correct term) that has the list of parameters.  It is read from, not written to.

 

One example of  a code change I made that made the data bad: Added an addition operator icon to the block diagram, then immediately deleted it from the block diagram.  I did not touch anything else, nor connect any wires to the addition icon.  That is what I meant by any change in code.

 

The data type of 28 is a double in LabVIEW.  I think it's a 4 bit long in the dll.  I'll have to check when I get to work tomorrow.

0 Kudos
Message 5 of 6
(2,484 Views)

Hi bomluuk,

 

The data type of 28 is a double in LabVIEW.  I think it's a 4 bit long in the dll.

Facts:

- a DBL takes 8 byte of memory.

- a "4 bit long" number is a nibble or half of a byte

- a SGL takes 4 bytes

- you can convert a SGL to a DBL…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(2,471 Views)