Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem setting VI_ATTR_SUPPRESS_END_EN Attribute for my TCPIP MBSession

Hello,

 

im using the NI-VISA for c#.

I have to set the VI_ATTR_SUPPRESS_END_EN Attribute to false in order to get my query with an instrument working.
I have already checked it with MAX and its working perfectly. In MAX there is a checkbox on the VISA test panel to change this property.

Unfortunately i can't find a "VI_ATTR_SUPPRESS_END_EN" property of my TCPIP MBSession Object in my Visual Studio - C#.
There are lots of properties but this one is missing!!! 😞

Why is it missing? What else can i do to set this attribute?
Thanks in advance!

0 Kudos
Message 1 of 11
(8,181 Views)

take a look at the NI VISA manual page 3:104 it has some information you can use. http://www.ni.com/pdf/manuals/370132c.pdf

National Instruments
Applications Engineer
0 Kudos
Message 2 of 11
(8,150 Views)

Hello,

 

I'd like to ask if there has been any resolution on the post. I looked at the attribute details in the VISA Programmer Reference Manual - but the manual does not mention how the attributes are mapped to properties in .NET Measurement Studio.

I am having the same problem. I cannot seem to access the VI_ATT_SUPPRESS_END_EN attribute from my C#.NET environment. Many of the other attributes are exposed through properties on the MessageBasedSession, but I don't see any property to expose the Suppress End On Reads. Is this attribute accessible via properties in .NET?

 

Thanks,

James

0 Kudos
Message 3 of 11
(8,036 Views)

After a little more digging, I noticed that there are some public methods on Session to directly access VISA attributes. The tricky part is that they are decorated with the [EditorBrowsableAttribute(EditorBrowsableState.Never)] attribute, which hides them from Visual Studio Intellisense. This solved my problem:

 

session.SetAttributeBoolean(AttributeType.SuppresEndEn, false);

 

where session is a MessageBasedSession object

 

Thanks,

James

 

Message 4 of 11
(8,031 Views)

@jmckee wrote:

After a little more digging, I noticed that there are some public methods on Session to directly access VISA attributes. The tricky part is that they are decorated with the [EditorBrowsableAttribute(EditorBrowsableState.Never)] attribute, which hides them from Visual Studio Intellisense. This solved my problem:

 

session.SetAttributeBoolean(AttributeType.SuppresEndEn, false);

 

where session is a MessageBasedSession object

 

Thanks,

James

 


Thank you for this information.

 

I needed to set this property to enable communication with a piece of equipment with Telnet port.

 

 

0 Kudos
Message 5 of 11
(7,234 Views)

Hello,

 

I have the same problem as discussed in the original post. That means i also want to set the VI_ATTR_SUPPRESS_END_EN attribute to false in order to get my query with an instrument working. I'm using NI-VISA .NET API instead of VisaNS. Does

 

session.SetAttributeBoolean(AttributeType.SuppresEndEn, false);

 

only work for VisaNS (session is a MassageBasedSession)? How can i solve the problem when using NI-VISA .NET API? I cannot call "SetAttributeBoolean" in my C#.Net environment.

 

 

Thanks in advance,

 

Rene

 

0 Kudos
Message 6 of 11
(6,088 Views)

Try:
((INativeVisaSession)session).SetAttributeBoolean(NativeVisaAttribute.SuppressEndEnabled, false);

Message 7 of 11
(6,083 Views)

Hi,

unfortunately I have the same issue. I need to set "Suppress End on Reads" in my c# programm. Using MAX the communication works and I get no timeout issue, but how to reset Suppression in C#.

 

I start my session with

 

mbSession = (MessageBasedSession)rmSession.Open("TCPIP0::192.168.8.80::2268::SOCKET");

 

using NationalInstruments.Visa.

 

Maybe somebody can give me a hint how it will work.

 

Thank you very much.

0 Kudos
Message 8 of 11
(5,428 Views)

Hi again,

 

I just noticed that VISA Interactive Control will also work fine if I enable the termination character. But Unfortunately this don't change the situation with my programm. I add the lines

 

mbSession.TerminationCharacter = 0x000A;
mbSession.TerminationCharacterEnabled = true;

But have still the same timeout exception at the read command.

0 Kudos
Message 9 of 11
(5,414 Views)

Hi,

 

ok, got it. I have to add

mbSession.SendEndEnabled = true;

as well to solve my problem. This has nothing to do with the VI_ATTR_SUPPRESS_END_EN Attribute but I post my result here to provide some new ideas for someone having the same issues.

0 Kudos
Message 10 of 11
(5,412 Views)