From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Putting bytes into Intensity graph

Hey.

I am doing my bachelor in Labview, and think its an awesome program. 
I have a thermal sensor with 16 pixel camera. I am using Arduino 2560 micro-controller as a pure transmitter to Labview.

The Arduino Sends over a package of 32 bytes to Labview, whitch contains temperature measurement.

Each square in the thermal sensor is 2byte, and the thermal sensor is 4X4 square.

 

I have downloaded the labview interface for Arduino and established connection. 

 

I have problems with putting the bytes into the Intensity graph.

 

I want to put the values starting in the left corner, and filling it in like a book.

 

I have added a picture which explains the problem more detailed.

 




0 Kudos
Message 1 of 8
(3,018 Views)

xalonso,

 

Here are some ideas to get you started.  This clearly does not do exactly what you want. However most of the parts you need are shown.

 

Lynn

 

Intensity graph.png

0 Kudos
Message 2 of 8
(3,013 Views)

Hey. 

Thanks for reply.
I have tried creating the module, as you showed me, but encountered a few problems.

1. The subtract and add in the loop, will not accept the wire connection. 
2. I have added the arduino into the loop, is this done correctly?

3. And last but not least the loop condition is wrong (bottom right corner), can anyone see what I have done wrong here?


Please take a look at attachment and write if you see any solution.

0 Kudos
Message 3 of 8
(2,989 Views)

@xalonso wrote:

 

1. The subtract and add in the loop, will not accept the wire connection. 


Your wire has no source. Connect the broken wire to the "4" diagram constant too. (Lynn does not show dots are wire junctions, so it is a bit hard to see in his image)

0 Kudos
Message 4 of 8
(2,980 Views)

Helpful hint: While programming, always keep the Context Help window visible.

 

When you move the wiring tool over a broken wire, the Context Help window displays a message about the problem with the wire. In your diagram it would tell you that the wire was not connected to any source.  Every wire must be connected to exactly one source (a constant, a control terminal, or an output of another node) and to one or more sinks (indicator terminals or inputs to other nodes).  In my example I had the 4 constant wired to both of the dimension inputs of the Resize function. Connecting a wire from the constant to the broken wire will fix that.  You need to determine whether 4 is the value you need.

 

By wiring a True to the Stop if True terminal of the loop you force it to stop after exactly one iteration. Clearly, one iteration will not fill your intensity graph. You need to determine how many iterations will be needed to fill the Intensity graph. That will depend on the size of each block received from the Arduino (16 or 4x4) and the size of the image you expect to get.  My example arbitrarily chose 64x64, but it also does not fill the graph. You may need to subtract the column index until it reaches zero without changing the row index.  Then add to the row index and reset the column index to 63 to start the next row of blocks.  This requires clightly more complicated logic for the index shift registers.

 

I have no experience with the Arduino. It appears that you appropriately initialize and close the connection, but you never actaully read any data from it. The inner for loop will probably be replaced by your Read from Arduino VI.

 

Lynn

0 Kudos
Message 5 of 8
(2,974 Views)

No dots.  I think dots were not an option when I first started using LV, so I almost never use them.

 

Lynn

0 Kudos
Message 6 of 8
(2,973 Views)

Hey.

Thanks for quick reply.

I experience some problems connecting the Arduino 2560 to the computer, that are now okey.

I have connected the Thermal camera to the Arduino and are currently running the labview program.

 

I am not receiving any information into the Intensity graph.

I am sending 32 byte over the Arduino, into labview where I want to display in the 4x4 graph (each square represent 2 byte)

 

can you tell me a bit more about the while loops constant.
1) row index 0,31 does this mean for 32 byte?

2) initialize array 0? What does this element mean?

im quite confused why my graph shows nothing...

0 Kudos
Message 7 of 8
(2,938 Views)

Please post your most recent code. There have been many suggestions and I do not know what you have in the VI you are now using. Also, include the Arduino subVIs.

 

1) None of the while loop shown in this thread have a 0 or 31 for row index.  So I do not understand this question.

 

2) When you initialize an array, you create an array and all the elements are set to the same value.  The value connected to the "element" input of the Initailize Array function does two things: It defines the datatype for the array and it sets the value to which all the elelments are initialized. In the image I posted the output of the Initialize Array is a 64x64 array of I32 (singned 32-bit integers) with all elements = 0.

 

Have you verified that the Arduino Read VI is producing non-zero values? 

 

Lynn

0 Kudos
Message 8 of 8
(2,933 Views)