LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Program Not Running Without Highlight Execution Button

 

 


That's even worse.  Now you have the number of bytes you are writing connected to the number of bytes to read.  There is no correlation between those two values.


 

I forgot to fix that

Omar
0 Kudos
Message 11 of 21
(2,254 Views)

Hey omar thank you for your help. 

 

I have one question that I am using the Delta Electronics's DOP03S211 HMI. And getting delay in data transmission from LV To HMI. So HMI is Responsible for this Delay?

 

And the vi which you send me that run very well and passing the data in sequence one by one  but some time getting TIME OUT ERROR in VISA CLR .So that time i have increased the time out from 10000 to 150000. But this is not the solution so pl tell me how should i came out of this.

 

Regards.

 

0 Kudos
Message 12 of 21
(2,236 Views)

I don't think the error is coming from the CLR command, but from one of the many VISA READS that come before it.

But with the way your code is designed how do you know which one is the problem. Once anyone message ERRORS out, that error is passed along to the end. What was the first message that did not get a reply?

 

How fast can your device process commands? I not talking about the time out, but the time in between commands. How soon after processing one command is your device ready to receive it's next command?

 

You need to process your commands one at a time and that includes checking for errors and try to recover, or re-synchronize with your device or retry the message before moving on to the next message. You need to rethink your "I'm-Going-To-Do-Everything-At-Once" plan.

 

As had been mentioned to you before, you need to rethink and redesign your program.


altenbach wrote

You also have way too much duplicate code. All your case structures are nearly identical, differeing only in a single string constant. All that belongs in the case structure is the string constant. 


Is this a VI that you call from a high level VI? Or are you running this VI with the "Run Continuously" button?

 

You still have a problem if "SEND" and "READ" are both TRUE

 

Omar
0 Kudos
Message 13 of 21
(2,213 Views)

Let's revisit the Termination Char.

 

You are sending both a "Line Feed" and "Carriage Return". Depending on your device, only a single "Carriage Return" maybe necessary. Plus be sure you have disabled the Termination Char on Send using the VISA property node. If you do not disable the Send Termination, VISA will add an extra Termination Char along with the ones you have already added to your message.

 

By sending both a "Line Feed" and "Carriage Return" or the auto added termination char, depending on your device it may be sending you un-expected extra blank lines. Or your device might send you an ERROR message telling you that it does not like blank lines with out a message in it. That extra blank line if not processed correctly by you on your end may be getting your code "out of sync" with your device for the messages that follow and causing them to error out.

 

What EXACTLY does your device send back from a SINGLE message. When I say EXACTLY, I mean EXACTLY down to the last none printable byte. Close LabVIEW and use a terminal program to see what EXACTLY your device is sending you. You may need to turn on a HEX display to see all the none printable stuff your device is sending you back. You will need to design your code to process each message reply completely down to each and every byte, before going on to the next message. 

 

Your Clear command could clear the extra blank lines if your timing is correct. But, if you clear the input buffer too soon before your device sends the extra unwanted blank lines and the extra unwanted blank lines arrive at the comm port after you have cleared it, then the extra unwanted blank lines will messup the messages that follow.

 

Best to get the Termination correct so you are only getting back exactly what you are expecting.

Omar
0 Kudos
Message 14 of 21
(2,202 Views)

Hey OMAR ,

Thank you the program is running sucssefully and their is a mistake in my string.

 

so running without error.In this program i have made the HMI as SLAVE device and LV as MASTER device.

 

Now the guide told me to make HMI as MASTER and LV as SLAVE, i.e the data written in the LV should be read by the hmi and data displayed on hmi. So strings are different now.

 

I have crete the string but how the hmi read the data from lv???//// What should i do?  I am upset pl help and show me the path.Smiley Sad

 

String :- :010300000001FB

 

I am attaching the LV and the sector 1,2etc should be read by hmi and displayed on hmi

 

0 Kudos
Message 15 of 21
(2,179 Views)

 

“make HMI as MASTER and LV as SLAVE”

If LV (LabVIEW) is the slave then you set it up like you tell a young child.

“Do not speak unless spoken to”

So instead of sending a command (VISA Write) and waiting for a reply (VISA Read), you are going to quietly wait for a command from the master and only send your reply after receiving a command. VISA Read – VISA Write.  

 

This should get you started. YOU CAN FILL IN THE MISSING PARTS

 

You need to check the return codes from the VISA Read, These are the ones most needed.

VISA:  (Hex 0x0) Operation completed successfully.

VISA:  (Hex 0x3FFF0005) The specified termination character was read.

VISA:  (Hex 0x3FFF0006) The number of bytes transferred is equal to the requested input count. More data might be available.

VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed.

This snippet is in LV2009

Slave.png

Other error codes you may want to trap are

VISA:  (Hex 0xBFFF003E) Could not perform operation because of I/O error.

VISA:  (Hex 0xBFFF006B) A framing error occurred during transfer.

VISA:  (Hex 0xBFFF006C) An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived.

 

If I forgot to mention it, you will need to fill in the missing parts based on YOUR device.

Omar
0 Kudos
Message 16 of 21
(2,165 Views)

Hi OMAR

 

I have read the post from you. Here from the HMI i m getting 2 type of string (1) Start with :0103...... for read the lv (2) Strat with :0106.....data write in hmi. How should i compare the first four char of the string and then as per the full string of the register the data should read and write. .

 

Now after placing the post i have tried the one lv and data is read by the hmi and as i m changing the "sector no" it showing in the hmi. but now i m running the program but getting Error-1073807360. and wondering why this error is comming previously its not coming but now its is comming. pl check the vi named "New" . Tell me is it right as per yor post?

 

And as per yor rpl i have tried the program and getting again Error-1073807360 it is coming in VISA SERIAL. i have try to understang the program but not getting successful in that. So pl explain it in detail.and as per the pic from you i have made the program but again problem cuming. VI is named as "again".

 

my exam(presentation) has shift to 8 march and want to complete the program befor my eaxm(presentation).Tell me wat should i do??Smiley Sad

Download All
0 Kudos
Message 17 of 21
(2,124 Views)

VISA:  (Hex 0xBFFF0000) Unknown system error (miscellaneous error).

Not much I can tell from that. Most likely caused by something outside of your LabVIEW VI code.

 

 

Do you have other software running that might be using the same resources as your com port? I/O Range? IRQ?

Windows Device Manger, does it show any problems with your comports?

Maybe the Windows driver for your com port?

Maybe the driver for the multiport com port device your are using (seeing you have a COM8).

Can you receive messages from com8 using MAX (Measurement & Automation Explorer)?

Can you receive messages from com8 using a terminal emulator 

 

Is the error on the VISA Read or the VISA Write?

Reboot your system?

Reinstall your multi-port device software?

Reinstall VISA software?

Reinstall????

 

Omar
0 Kudos
Message 18 of 21
(2,104 Views)

Hi OMAR

 

I am getting error in VISA Serial. I have used the highlight execution button to find out the place where the error occurs. 

 

Using the COM8 i can transmit and receive the data in DOCKLIGHT Software successfully. Yesteray some times the i have to remove and reinsert the usb port and then docklight get the reponse. Previously this is not happened. Device manager showing that "device working properly". and iam using the VISA503. So i am downloading the latest version of visa 5.2.

 

Is this problem is coming because of the USB to SERIAL converter? I have read in one forum. and i have search for the "Terminal Emulator" but not undershood it.

 

what to do?

0 Kudos
Message 19 of 21
(2,080 Views)

Docklight IS a terminal emulator so we know your comport works.

But I am not familiar Docklight.

 

Most likely you can't have Docklight and LabVIEW trying to talk to the same comport at the same time.

If Docklight has control of the com port and LabVEIW tries to open the comport LabVIEW will throw an error.

But I would think it would be a different error than the system error you quoted.

Be sure Docklight and LabVIEW are not open at the same time. One or the other, but not both.

 

Close down LabVIEW. Close down Docklight. Open National Instruments MAX and open a "VISA Test Panel" for the com port in question and see if you get any errors. Try to send and receive. This will tell you if VISA is working for your com port in question.

 

If the VISA Test Panel works without an error, then try the VISA Open function in LabVIEW to see if you still get the error.

 

VISA Open.png

 

 

Omar
0 Kudos
Message 20 of 21
(2,062 Views)