LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ComBreak duration time is changing from call to callr

Hello,
I need to generate a break for one millisecond on the rs232 COM port to build up a LIN communication. For that I'm using the ComBreak() CVI function.

Monitoring the communication with an oscilloscope and running the ComBreak() function in a loop I can see, that the duration of the break signal is changing from call to call.

The duration time of the signal is changing between  1ms and just some micro seconds.

Is there a patch existing to fix this problem ???

I' m using CVI 5.5.

 

 

Thank you in advance for your help !

 

 

best regards

diver

 

0 Kudos
Message 1 of 20
(5,357 Views)

Hey diver,

 

I think a better low-level approach for controlling the VISA attributes that configure the break feature will be better for your application.  To do this you'll need to use a set of 8 function calls.  As shown in the attached screenshot of LabVIEW code, you'll need to use a viGetAttribute to obtain the previous attribute and store that to a variable, then use viSetAttribute, both for the break length (VI_ATTR_ASRL_BREAK_LEN) to set the break duration.  Once that's done you'll need to do the same function calls for the VI_ATTR_ASRL_END_OUT attribute.  Once the previous values have been written to variables and then new values written in, send an empty string.  Then you'll use the variables from your previous viGetAttribute function calls to rewrite using viSetAttribute functions for your end out and break length attributes.  Let me know how this function set in place of our ComBreak() call.

Thanks,

David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
0 Kudos
Message 2 of 20
(5,308 Views)

Hello DavidP,

first of all thank you for your help.

As I wrote I'm using LabWindows CVI 5.5.

I didn't use VISA functions in the past, so I'm not familiar with them.

I never used LabView, therefore I do not understand the attached screenshot.

I tried to use the functions you wrote in your posting. 

The function viSetAttribute is also available in CVI, but the attribute VI_ATTR_ASRL_BREAK_LEN could not be found.

Do you have an example code witten in C ?

 

regards

Michael

0 Kudos
Message 3 of 20
(5,281 Views)

Hello,

I just did a compare between CVI 9.0 and CVI 5.5.

In the installed trial version CVI 9.0 the VISA function viSetAttribute has the possibility to change the attribute VI_ATTR_ASRL_BREAK_LEN.

In CVI 5.5 the attribute VI_ATTR_ASRL_BREAK_LEN is not provided.

Is there a possibility to solve the problem with my licensed  version 5.5 ?

Thank you in advance.

 

regards

Michael

 

 

0 Kudos
Message 4 of 20
(5,278 Views)

Hey diver,

 

I'm in the process of virtualizing your CVI 5.5 installation so I can see what attributes we do have accessible or can make present on your system.

 

Thanks

David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
0 Kudos
Message 5 of 20
(5,255 Views)

Hey diver,

 

So I've simulated your CVI setup and am now currently trying to determine what version of NI-VISA you should install to get that attribute available in your CVI 5.5 environment.  Without the NI-VISA attributes I initially referenced in my first post, you won't have the control you need at the low level to adjust the break time.  I'll post back once I find a suitable version of VISA for that attribute.

David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
0 Kudos
Message 6 of 20
(5,174 Views)

Hello DavidP,

thank you very much. I will be waiting for your  next post.

 

Michael

0 Kudos
Message 7 of 20
(5,132 Views)

Hey Diver,

 

The installation of any version of NI-VISA should get you the attributes I referenced in the previous posts.  However, I feel that the ComBreak() command you're sending isn't showing the desired 1ms break due to the fact that serial communication is asynchronousby nature so that type of determinism will not likely be deterministic on a Windows base platform.  The lower level controls that the VISA VI Attributes give you will help but may not be a perfect solution due to the characteristics of serial communication.

David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
0 Kudos
Message 8 of 20
(5,114 Views)

Hello DavidP,

as I wrote in a previous post the attribute VI_ATTR_ASRL_BREAK_LEN is not provided in my installed NI-VISA version. So I do not have a possibility to change the length of the break singnal.

 

Michael

0 Kudos
Message 9 of 20
(5,096 Views)

Hey Diver,

 

The attribute is not visible in the attributes search in the CVI environment; however, with NI-VISA installed (for my test station is was CVI 5.5 and NI-VISA 4.5) the attribute is defined in the visa.h header file and can be used in the CVI environment.  To open and see the visa.h header file to verify this, go to this directory: C:\Program Files\National Instruments\Shared\CVI\include.  If you look in this header file, and search for "VI_ATTR_ASRL_BREAK_LEN" or the other attributes I've mentioned, you'll find them defined in the header file.

Message Edited by David P. on 04-16-2009 10:14 AM
David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
0 Kudos
Message 10 of 20
(5,070 Views)