LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Please help! I have no idea what I am doing

Solved!
Go to solution

@Ray.R wrote:

tbob...

 

what are we going to do with you... slipping up like that.. 😉

 

.... as if I've never slipped up!  LOL!!!   okay... let's not compare our slip up ratio... I don't want to be embarrased.  😉  😛


Ray:

Actually, I slipped up again.  I assumed that my string control was set to normal display.  After checking it, it is set to Hex display.  Ooops again.  I must have just copied the control from the original program to my new one.  So the correct command is being sent, if 0xBE is the correct command.

 

Laplanmd:

Since the sample count is -1 and the data buffer is unchanged from intialization (full of 32768), this leads me to believe that the serial write was executed (BE was sent to the device), but no serial data was received back.  If any serial data was received, the sample count and data buffer would have changed.

 

The problem could be the Termination Character.  Look at the extreme left of the code, before the loop.  The first icon after Error In is the VISA Serial intialization.  There is a boolean False wired in from the top.  This disables the termination character.  This is not normal.  The termination character tells the computer that the device has finished sending all of its data.  However, this is the way it was set in the original code, so I don't know how that ever worked.  Try changing the False to True (just click on it using the finger tool).  Run the vi.  If this works, save the vi.  If it doesn't, let me know and we will look elsewhere.  However, I am very sure that you are not receiving any serial data from the device.  Please check to see that BE is the proper command to send, and check to see if the Write Buffer control on the front panel is set to BE, and that the Hex Display is checked (right click on the control and look for the menu item Hex Display, it should be checked).

 

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 21 of 27
(901 Views)

The Write Buffer was set-up to the way you have told me. It has the BE and it is set in Hex.  I tried changing the False to True and that did not make any difference. I just remember that the guy making the code gave me a user's manual that describes some of the hardware and labview set-up before he bailed on me. I attached the pdf because it may help you figure out what may be wrong. I would agree that it is not receiving data from the device.

0 Kudos
Message 22 of 27
(889 Views)

You're both on the right track because Error -1073807298 is related to VISA (or USB) communication.  The communication is broken for some reason.  That is why I initially suspected the USB device or it's connection.  You're saying that the USB communication is fine, right? 

 

.... hummmmm.....

0 Kudos
Message 23 of 27
(881 Views)

Yeah I can guarantee that the connection is good because I tested the device/USB connection by using the previous program and it works fine.   

0 Kudos
Message 24 of 27
(866 Views)
Solution
Accepted by topic author laplanmd

After reading the PDF, I realize that the original VI was written by the company that provided the equipment.  Very poorly written I must add.  However, since it worked fine manually, I left the original intact except for removing the two manual buttons and replacing them with timers.  After 300 seconds, 0xBE is sent to the device.  10 seconds later, Process Data happens.  The timers are reset so that the cycle can repeat.  The rest of the code is unchanged.  I could not find a any fundamental difference between my re-write and the original, except for getting rid of those local variables.  But perhaps I made some slight error that prevented it from working.

 

This version, like the previous one, must be converted to 7.1.  I cannot do this.  If this version does not work, then something in the conversions process must be messing things up.  At that point, I can advise how to change the original vi manually.

 

 Make sure the COM port is set correctly on the front panel control called VISA Resource name.  I have it set to COM 1.  A USB to serial converter will probably be set for some other COM number, like COM3.  Could be this is why my previous version did not work.  But my previous version also did not have the 10 second delay for processing data.  So use this latest one.

 

- tbob

Inventor of the WORM Global
Message 25 of 27
(862 Views)

Thank you so much! This actually works. Not quite sure what the difference was between the two, but anyways it works. I can't thank you enough. Is there a way that I can compensate you for your help? If there is you can send a private e-mail to me at laplanmd@clarkson.edu. Also, I would like to give you credit in the paper I am writing so if you want to give me your name send it to my e-mail. Thank you again!

0 Kudos
Message 26 of 27
(833 Views)

I'm a volunteer here, no compensation is necessary.  I'll contact you via private email.  I would like to learn more about your project to help me understand the code better.  In a way, you could say that I didn't know what I was doing either.  I just changed the code to add timers to replace manual pushbuttons.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 27 of 27
(825 Views)