ByVal or ByRef in LabView

Hi all

When I LabView7.1 and 8.5 with call node of .NET, I found a different behavior depending on the input/output terminal. In LV7.1, each parameter has two input and output terminals; but in LV8.5, only the parameter claimed as ByRef has output terminal.

There are 2 problems:

1, in .NET, even if a parameter object is claimed as a PaintEventArgs, since this is the type of reference, it can always be changed within the Assembly. So in LV8.5, how to pass the argument after change, because there is no terminal output?

2, LV7.1, if the parameter is claimed as ByRef, its type will be .NET object. It's really annoying. I have a string argument to pass in the Assembly, and the setting is claimed as ' out...» As String", then the entry Exchange node to be an object instead of the original string type. But how can I convert the normal to be a .NET object string constant?

Can any guru give me instructions? Thank you.

constant wrote:

Smercurio,

Your post is really precious! Then, same 'objet.net' cannot work? I just googled this method and wanted to use it. Desperate.

I didn't say "may not work. I said that I didn't know if it would work. Please do not put words in my mouth.

I know that in the points of reference for language text to memory, so that I can use the reference directly after changing the content. In LabView, you know that the reference is passed by a "thread". So you're saying, just after the callee, the thread changes its value? Amazing, but confusing too. If I lie 2 lines of the same object, one of them happened in a .NET assembly, while the other is not, what happens? I really think to use 'the power' terminal can avoid ambiguity.

If you are dealing with an object information will be valid because the wire is the value of the reference, not the value of the content of the object. For example, if you create this simple assembly:

using System;
using System.Collections.
using System.Text;

namespace StringReverse
{
public class Class1
{
public void ReverseString (ref string stringToReverse)
{
Char [] rev = stringToReverse.ToCharArray ();
Array.Reverse (rev);
stringToReverse = (new string (rev));
}

public void AddToArray (array, ArrayList)
{
table. Add ("Hello");
}
}
}

So, if you create an ArrayList object on the block diagram, you can see the change in the object as shown below:

Tags: NI Software

Similar Questions

  • Tiara (image) to the database file

    Hi all

    Recently, we found a problem with our application. Instead export the report to a network drive images, we save it in a database.

    So far, we have saved on a network without any problems. We are able to access our database and insert some text values in the application, but now we need to save files (images). This is where things are more complicated. Tiara features a textStream object, but not an inputstream that allows to read a byte array...

    Then, someone had a problem like this and found a solution? I found a few samples of something similar on the site of NOR, but they are all for labview...

    Any help is greatly appreciated,

    Tomas

    Void Base64StringToFile (ByRef, ByVal fullFilePath vCode)

    If FileExist (fullFilePath) then
    FileDelete (fullFilePath)
    end if

    Dim OXML: Set oXML = CreateObject ("Msxml2.DOMDocument.3.0")
    protected oNode: Set oNode = oXML.CreateElement ("base64")
    oNode.dataType = "bin.base64".
    oNode.text = vCode

    Dim BinaryStream: Set BinaryStream = CreateObject ("ADODB. Stream")
    BinaryStream.Type = 1
    BinaryStream.Open
    BinaryStream.Write oNode.nodeTypedValue
    BinaryStream.SaveToFile fullFilePath

    Set BinaryStream = Nothing
    Set oNode = Nothing
    Set oXML = Nothing
    End Sub

    Sub Base64FileToString (ByVal fullFilePath, ByRef vCode)

    Dim BinaryStream: Set BinaryStream = CreateObject ("ADODB. Stream")
    BinaryStream.Type = 1
    BinaryStream.Open
    BinaryStream.LoadFromFile (fullFilePath)

    Dim OXML: Set oXML = CreateObject ("Msxml2.DOMDocument.3.0")
    protected oNode: Set oNode = oXML.CreateElement ("base64")
    oNode.dataType = "bin.base64".
    oNode.nodeTypedValue = BinaryStream.Read)
    vCode oNode.text =

    End Sub

    I've used these two methods to read binary files and put it in the base64 string. Maybe it helps.

  • Unpredictable/inconsistent logon?

    Similar to this topic: why ODP open connections redundent

    I wrote a VERY simple console app VB in order to check if it makes a difference if you pass an object of connection DB ByVal or ByRef in VB.NET.

    It seems that this has no importance, but I have observed a VERY STRANGE behavior with the code.

    With the program run as below, check session $ v in Oracle to monitor how many sessions opened I see this:

    Breakpoint #.

    Sessions

    1

    1

    2

    1

    3

    1

    Program closed

    0

    The only thing here is that after

    1. Conn. Close()
    2. Conn. Dispose()

    The session is still open-weird but not overwhelming.

    HERE'S THE ODD BIT:

    Uncomment the 2 lines in Main() which create a second connection...

    ' Uncomment the 2 lines below to see the CRAZY behavior.

    Dim conn2 As new OracleConnection (oradb)

    conn2. Open()

    now when I run the program I see:

    Breakpoint #.

    Sessions

    1

    3

    2

    4

    3

    5

    Program closed

    0

    I suspect it's something to do with the connection pooling, but it seems totally illogical and could easily explain why we have a problem with the connections in a system spiraling out of control.

    I use VS2013, v2.0.50727 Oracle.DataAccess with OraClient11g, it's just a console application simple VB on .net 4.5 running against Oracle database 9

    Code:

    Imports System.Data

    Imports Oracle.DataAccess.Client

    Imports Oracle.DataAccess.Types

    Module Module1

    Sub Main()

    ' Deleted... connection details

    Dim oradb As String = "Source = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) data (HOST = < snip >)(PORT=1521)) (CONNECT_DATA = (SERVICE_NAME = < snip >))); User Id = < snip >; Password = < snip >; »

    Dim conn = New OracleConnection (oradb)

    Conn. Open()

    Dim cmd As new OracleCommand

    Connection group conn cmd.

    cmd.CommandText = 'select sysdate from double'

    cmd.CommandType = CommandType.Text

    Dim dr As OracleDataReader = cmd. ExecuteReader()

    Dr. Read()

    ' Uncomment the 2 lines below to see the CRAZY behavior.

    ' Dim conn2 As New OracleConnection (oradb)

    ' conn2. Open()

    Sub1 (conn)

    ' Breakpoint 2

    Conn. Close()

    Conn. Dispose()

    ' Breakpoint 3

    End Sub

    Sub Sub1 (out dbconn)

    Dim cmd As new OracleCommand

    cmd connection the Group dbconn

    cmd.CommandText = 'select sysdate from double'

    cmd.CommandType = CommandType.Text

    Dim dr As OracleDataReader = cmd. ExecuteReader()

    Dr. Read()

    ' Breakpoint 1

    dbConn. Close()

    End Sub

    End Module

    I wouldn't say five connections such as spiral out of control. The difficult part of creating a generic connection pooling algorithm is to predict how many connections to keep idle in the pool. There is really no good answer.

    For example, when all users log on to work in the morning, the connection pool should quickly try the more open connections to accommodate all the people who signed in quick succession. In this case, you may say that five connections is too little after two fast Open() requests.

    The best way to check if there are too few or too many connections in the pool is to increase the size of the Pool of minutes or decrease the maximum Pool size. Bring the Max Pool Size at a lower level, so too many connections are created.

  • LabVIEW 2016 NI_ReportGenerationToolkit error

    I upgraded to Labview 2015-2016, but when you open one having previously worked for the project I now see an error in the NI_ReportGenerationToolkit.lvlib:Excel_Save_Workbook.vi.

    He tells me that the invoke node contains terminal unwired or bad.  However, it's a NOR provided VI and has not been changed between updates. Please let me know if it is a solvable issue.

    Take a look at this thread.

    Ben64

  • Please convert LabVIEW 2013 urgent please

    Please convert LabVIEW 2013 urgent please

    You can go there.

  • Please convert LabVIEW 13 10

    Can someone can convert LabVIEW 13 LV 10. These files come from the community

    Much thanks

    Here you are

  • DAQ Assistant is not in LabView

    Hi all

    I use NEITHER cDAQ-9174 and NI 9203.  I have already installed the driver for the NI 9174 cDAQ, which is NEITHER-DAQmx 9.8.0.  I can see the device when I opened NI MAX. However, when I open LabView 2015, I can't find DAQ Assistant in the function Palette. I noticed on the chassis, 'ACTIVE' light is not on while two other "POWER" and "READY" light is on.  I look in the forums OR but I can not find the solution.

    Any suggestion, please help!

    Thank you!

    DAQmx 9.8 is not compatible with LabVIEW 2015.  You must use at least DAQmx 15.0.  See here for more details: NOR-DAQmx and LabVIEW compatibility

  • LabVIEW FPGA SPI accident - SPI OR IP address for example - R series OR

    Hello

    I am trying to run the series R - sample project NI SPI FPGA Simulation.lvproj that comes with the SPI IP OR on a real FlexRIO FPGA SMU-7976R target with an attached digital adaptation NI 6581 B Module. The example is for a PCIe-7841R but I wore during my target FPGA, follow these steps and made additional changes to try to make it work with my set-up. I learned that FlexRIO FAMs CLIPs do not work with nodes in office had so I know I can't simulate the project originally planned so I will try to use FPGA to e/s node host side (open FPGA vi reference) to implement the actual hardware.

    My first question concerns my configuration of the adapter module e/s and selection. I added the IO Module (NI 6581 B: NI 6581 B channel) for my project and selected the channels as shown in the table below. I have a real physical hardware connection as described below using two NI SHC68-C68-D4 cables and a break-out Board.

    I changed the names as well:

    I selected these DIO channels because I wanted the DDCA connector to be the master and the DDCB connector to be the slave. In addition, in this CLIP every eight channels of i/o has a write enable signal. I have not used the Port configuration because I needed 4 available DIO channels and I saw DIO0-3. Is my logic of selection of channel vs correct Port here?

    Following the same strategy that examples FlexRIO/NI6581B, I changed the FPGA.vi to include initialization outside of timed loops:

    And in the Host.vi I have a node reference FPGA and wired loops of feedback accordingly:

    When I compile the FPGA and try to run Host.vi LabVIEW inevitably crashes with Crash Reporter below and must restart:

    Does anyone know what I'm doing wrong here? My guess is that it has something to do with the CLIP/IOModule. Any help is appreciated.

    Thank you

    Scott

    Hi Scott,.

    I suspect that the problem might be related to the fact that your node open FPGA VI reference is in the while loop and trying to open a new FPGA reference at each iteration.
    If you move outside of the while loop, it does not solve the crash?

    On channel vs port question, your logic seems reasonable to me, but I recommend to try it since this feature could depend on device.

  • LabVIEW 2014 does support CDAQ 9136

    I use LV 2014 SP1, I wanted to buy CDAQ 9136 Windows controller for one of my projects. I'd like to figure out if I can use the SP1 of 2014 LV with DAQmx15.1 in the program for this controller? User manual CDAQ 9136 does not say anything on the support of LV, just said that DAQmx 15.1 is supported.

    When I tried to add a target CDAQ in SP1 LV2014 with DAQmx15.1, it does not show the CDAQ 9136. I won't use the real time of the CDAQ 9136 version, but I'm confused. Any help would be greatly appreciated.

    Nanda,

    I would like to clarify the compatibility for the NOR-9136. It is compatible with DAQmx, starting with DAQmx 15.1. In other words, it can be used as a normal cDAQ chassis in any version of LabVIEW with DAQmx 15.1 or later installed (within reasonable limits). However, compatibility in real-time with the cDAQ-9136 has not introduced before LabVIEW time real 2015 module, which is only compatible with LabVIEW 2015. Thus, to use the cDAQ-9136 as a real-time controller, you will need 2015-LabVIEW and the module time real LabVIEW 2015 or later. This note can be found in DAQmx 15.1 notes for supported devices.

  • does anyone have a good recommendation for a voltmeter of PoE that can be integrated into Labview/TestStand?

    I started looking for a voltmeter of PoE, but so far all the ones I've found are for use of the mobile hand held.   I'm looking for a version that can be integrated in an automated production environment.

    Can someone point me to a voltmeter of PoE who has control USB or ethernet.   Ideally with Labview drivers. But if I do these myself I'll be okay with that.

    Unfortunately, I've not seen anything quite like that around. The closest I could find was the PoE3N-reach technology RT, which looks like it might have connectivity RS-232.

    Another option might be to type the tensions of the ESP and read those who use a more general tool as a DMM device or data acquisition. Something like the POET systems-FM-1. Maybe something like this work?

    There may be someone on the forum who is more familiar with POE that I am, but that's what I was able to dig up.

    William R.

    National Instruments

  • Use of LabView for exploitation of Bosch Rexroth HCS01

    Hello people,

    I am a student assistant and my current project is to complete what was launched in a work of degree more than a year ago: to build an experimental platform to test the effect of superconductivity on maglev technology. Part of this experimental platform is a precision three-rail network operated by compact inverters HCS01 (IndraDrive Cs) by Bosch Rexroth.

    My question is: is it possible to use LabView to operate the three axes of a central VI?

    I have already connected all three compact inverters to a computer and I am able to operate using most Ds-startup-easy mode, but I can only operate separately and not of a single window.

    Thanks in advance, any help would be appreciated!

    Greetings,

    Paul Masuch

    Hello world

    I just found this forum article on control components Rexroth with LabView and as a representative of Rexroth, I disagree that West no way is easier to control than using Ethernet/IP.

    We have an official partnership with National Instruments, and offers a complete Package of VI for all our components (IndrDrives and IndraControl automata) to access all the features of a PLC or lead of Bosch Rexroth. This is possible thanks to our Open Core of Bosch Rexroth and our open approach we take with our automation components. For controllers the VI contains more than 850 screws to communicate directly from your LabView execution to the controller. These packages are completely free for you and you can download the packages from our Web site

    http://www.boschrexroth.com/OCE

    (access after registration in our network in engineering).

    In addition it s also possible to control our readers a cRIO OR using the Council of Europe.

    Here's a sneak peek of our open main Interface feature. There are SDKS for several languages of programming and several technologies including National Instruments Soft - and hardware.

    So you see, West don't need to learn PLC programming, when you want to connect LabView to Automation from Rexroth.

    If you have any trouble Don t hasitate to contact me!

    Best regards

    Tammo Schwindt

    Application engineer

    Bosch Rexroth AG

    [email protected]

  • Allot of extra RAM for LabVIEW

    Hi all

    I'm out of memory trying to compile a great personality FPGA VI. LabVIEW generates an error and crashes when it reached the limit of 4 GB memory while generating intermediate files (specifically step 3/5). I have 8 GB of RAM installed on the laptop. I know that only 4 GB can be used by LV 32 bits, and it doesn't have a 64-bit version of LV FPGA. Does anyone have a solution or workaround for this? Decreasing again the size of my VI is not an option. I wonder if it is possible for compiling Xilnix itself of tools to access more memory?

    Mitch

    I don't think that would compile a project that includes only the FPGA VI. My project includes only the items that are needed to build the bitfile: DMA FIFO read & write, a global variable sub VI and two other sub screws, which are used in the FPGA VI. In my view, that a key issue, it's that it handles many groups that are up to 64 elements each. I took care not to include functions that take a lot of space on the FPGA, avoided constraint, etc., but the large paintings are an essential component.

    Yes, the Xilnix program itself is short of memory. If I remember correcly, the compiler showed the error message "a Xilnix request has run out of memory...". "and he said that 4 GB of RAM has been reached.

    I get to the conclusion that I have to wait for a 64-bit version of LabVIEW FPGA to be released (with a 64-bit compiler) to build the VI in the desired way.

  • LabVIEW Terminal connects not to the EV3 EV3 software retail will be (but pilot LEGO will not uninstall)

    Windows connects successfully to the LEGO EV3 via USB or Bluetooth.

    However, the Terminal LEGO of LabVIEW 2015 do not recognize.

    I installed the software at retail EV3 for check and it * is * connect to the EV3.

    I'm trying to fix the "LEGO Mindstorms NXT x 64" driver, but it will not uninstall even if I uninstall everything of LabVIEW, including the module (input administrator rights when prompted.)

    I've been struggling with this days, and I need to connect my EV3 to teach my students LabVIEW.

    Any help is greatly appreciated! Thank you in advance.

    -Associate Professor Matthew,

    #Date: Thu, January 21, 2016 17:21:58
    #OSName: Windows 7 Enterprise Service Pack 1
    #OSVers: 6.1
    #OSBuild: 7601
    #AppName: LabVIEW
    #Version: 15.0 32 bits
    #AppKind: FDS


    21/01/2016 5:27:54.774 PM
    Coolish 0x00BA6193:
    c:\nimble\penguin\labview\components\mgcore\trunk\15.0\source\ThEvent.cpp(267): coolish 0x00BA6193:
    Minidump ID: 789e6f18-0e9e-4b10-8b46-c0dd7448d8d4
    $Id: //labview/components/mgcore/trunk/15.0/source/ThEvent.cpp#1 $

    We found it!

    Our IT Department has been able to dig up in the driver package and finally managed to uninstall.

    Something has been damaged and the pilot wouldn't uninstall correctly.

    This fixed the problem beautifully.

    -Matthew

  • Using a neural network with box Toolbox MATLAB in LabView?

    I would like to know how to train a neural network in Matlab and use it in Labview? I know I should be using the MathScript, but as I do once the network formed in matlab is a dull file?

    Hi GringoButzlaff1,

    Well, it's not all MATLAB code/script that can run in LabVIEW using MathScript.

    If there is a function of IP (intellectual property) in the code, that is, any Toolbox MATLAB functions, you won't be able to execute it using the MathScript.

    In fact, you must call the MATLAB script node in your code. This node calls the script software MATLAB server to run scripts written in MATLAB language syntax and are only available for windows.

    Try encoding using the MATLAB script node and tell me if it worked for you.

    Best regards.

  • Cloud dashboard do not install it in 2014 of Labview

    Hi guys,.

    I try to use Dashboard Cloud with LabVIEW 2014.

    I'm https://decibel.ni.com/content/docs/DOC-38359 but the attachment at the bottom of the manual does not open in VIPM Labview Tools Network. Instead, I get the general with 244 page different tools but without the tool dashboard of the clouds.

    Does anyone know if there is an incompatibility with the LabVIEW 2014 with the palette/tools/examples of clouds Dashborad?

    See you soon

    I solved it, thanks. A reboot did the trick

    THX

Maybe you are looking for

  • How do you know if your itunes account has been hacked?

    Just to have an email with an invoice of apple's music that I didn't sign up for - how can I verify that this is legitimate and not a phishing scam? Can't find anywhere my subscriptions to see if a subscription to apple's music is now on my account!

  • Computer HP laptop-15: activation code/product key

    I have the hp to access my computer remotely to fix the webcam. (before 90 days of free support was up). I never received the product key/activation code for cyberlink power dvd 14 media player cannot play the dvd on my laptop When I called to ask fo

  • Windows Vista does not recognize external USB 260 GB HARD drive

    I have a 260 GB Seagate external hard drive, a laptop Toshiba satellite and Windows Vista Basic. The same Windows usually choose the hard drive when I plug it, it does not appear in Device Manager and in disk management, the only way I can get it to

  • My whole Inbox hotmail - 11 years of my life - disappeared last week!

    Last week, all eleven of my Inbox before 6 March 2011 simply disappeared in the air! On hotmail help they only told me that I had "active pop" my account.  I don't even own a smart phone, and I've activated nothing new in the eleven years I had my ac

  • Failure of the Installation Windows 7

    I'm trying to upgrade Windows Vista Edition Home Premium to Windows 7 Home Premium (32 bit).  After you run the install disc, I got the message to uninstall Itunes, MS Intellitype, tool diagnosis of Modem Dell and Google Toolbar.  I did, and now when