LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MEASURING FORCE ON BALANCE USING AN ELECTRONIC BALANCE FROM THE SERIAL PORT


@labview1958 wrote:
I have been trying to plot a GRAPH of FORCE READING vs TIME. TIME here is from the starting point of RUNNING the LV. However I have not been successful.


1958,
The array you currently are building every time you get a weight value will only ever have 1 element. Get rid of the 'Build Array' and replace the Waveform Graph with a Waveform Chart. See if that suits your needs.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 11 of 22
(1,695 Views)
" However if I change by clicking on the BUTTON and change it from CONTINUE IF TRUE to STOP IF TRUE, it works fine."

I like to ADD if I change from CONTINUE IF TRUE to STOP IF TRUE, the LV gives one correct non-zero reading and STOPS. I would like it to keep giving non-zero readings. Thus I have added the FOR LOOP. I have not yet tested it with the balance. Would it work?

Regarding the TIME, I have followed your INSTRUCTIONS however it only records the last few readings on the GRAPH. ALL earlier readings are erased!. Can you HELP? I have attached the REVISED LV.
0 Kudos
Message 12 of 22
(1,677 Views)

@labview1958 wrote:
... I would like it to keep giving non-zero readings. Thus I have added the FOR LOOP. ... Would it work?. etc


1958,
Yes, you have to add a For Loop or While Loop to get multiple readings if you use this as a top level VI. Whether a For or a While loop is the better choice depends on your end requirements which I'm not going to guess at. You could also use this VI as a subVI ... in that case the loop would be better placed in the calling VI. The chart/graph problem will probably sort itself out once you get the correct program architecture. But no matter which route you take:
Do not initialize the serial port every iteration of the loop. Do it once at the very start ... and close at the very end.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 13 of 22
(1,661 Views)
" Do not initialize the serial port every iteration of the loop. Do it once at the very start ... and close at the very end. "

How do I take out "initialise the serial port" from the LOOP? Shall I leave the BUFFER inside the LOOP or shall I take it out?
0 Kudos
Message 14 of 22
(1,651 Views)

@labview1958 wrote:
How do I take out "initialise the serial port" from the LOOP?

1) Go to the sequence frame (#1) with the Serial Port Init.vi.
2) Use the 'Position/Size/Select' tool (the arrow) to select everything inside the frame. Left-click and keep the mouse button down on Serial Port Init.vi. Use the mouse to drag everything to the left and when it's outside the loop release the mouse key.
3) Move the "Port Number" control outside the loop by left-clicking on it and dragging it to the left.
4) Rewire "Port Number" to Serial Port Init.vi. Also wire "Port Number" to the loop and rewire it to the sequence structure.
5) Wire the "error code" output from Serial Port Init.vi to the loop. This is dataflow to ensure that the serial port is initialized before the loop executes and tries to read from the port.
6) Go back to the sequence frame showing the now empty frame#1. Right click on the frame and select 'Delete This Frame' from the pop-up menu.

Done. You have learned a basic editing technique.

"Shall I leave the BUFFER inside the LOOP or shall I take it out?"
Your choice. If you take it out and then have problems with extraneous bytes, just put it back in. Good way to increase your editing skills.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 15 of 22
(1,642 Views)
I have wired as suggested. I have attached the corrected copy here,Is it correct? Should the graph give force reading with time. Would it exclude the NON-ZERO readings?
0 Kudos
Message 16 of 22
(1,597 Views)

@labview1958 wrote:
I have wired as suggested. ... Is it correct?


1958,
All the serial port subVIs in the sequence structure have an unwired input for port number. Wire it up.
You can also check for errors reported by these subVIs; they all have an error code output which you currently aren't monitoring.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 17 of 22
(1,581 Views)
I would like to wire up but my tools palette in LV6.0 is missing! It is missing from ALL the VI's. I tried going WINDOWS---> SHOW TOOLS PALETTE but no use. However FUNCTIONS and CONTROL PALETTE works fine. What shall I do?
0 Kudos
Message 18 of 22
(1,574 Views)

@labview1958 wrote:
I would like to wire up but my tools palette in LV6.0 is missing! It is missing from ALL the VI's. I tried going WINDOWS---> SHOW TOOLS PALETTE but no use. ... What shall I do?

While the mouse cursor is over the Block Diagram:
-Hold SHIFT key down.
-Press the RIGHT mouse button.

The tools palette should appear.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 19 of 22
(1,563 Views)
Donald's suggestion is good if you prefer to use the palette that way, but I suspect you want a more permanent fix.

Somehow, you must have changed the screen resolution at a time when the LabVIEW tools palette had last been placed near the bottom or the right-hand edge of the screen. If, for instance, you changed from 1024x768 to 800x600 resolution after placing the tools palette at the right-hand edge of the screen, it would now seem lost, because it is sitting off-screen.

One fix is to edit the labview.ini file found in the same directory as labview.exe. There should be a line in called like this:

toolPaletteLoc=55,945,214,1023

You can safely delete that line, save the labview.ini file, and then re-launch LabVIEW. You'll find that the tools palette is visible again when you choose Window >> Show Tools Palette.

This has been a problem for some users for long enough that you might think NI would modify LabVIEW to use a default location if the last saved position of a palette is beyond the current display bounds. I'm going to check the beta and submit a suggestion if it isn't already changed.

Regards,
John

Message Edited by Johnner on 05-10-2005 09:16 PM

Message 20 of 22
(1,564 Views)