Tcp/ip ni-visa commands using visual basic

what are the dll and bas files i need to communicate with a device via rj45 cable thru visbual basic , i can communicate when i use hyperterminal but i can't via visual basic
tcpip::192.168.48.11:: this is where i'm stuck
Solved!
Go to Solution.

hi,
thanks i found that file. we recently purchased a gpib to usb and i used the call commands and everything worked out fine via visual basic i was able to talk to the device and everything.
but i'm still stuck on how to connect to the device via ethernet cable. my address is 192.168.48.11
so the way i have to write is  viWrite&(ByVal vi&, ByVal buf$, ByVal count&, retCount&) 
i have no clue what all that stuff means this is how far i got what do i put after the ipaddress?
viWrite&(tcpip::192.168.48.11
do you guys have examples for this, if i can't figure it out can we pay national instruments for a software engineer to help us write a program,

Similar Messages

  • Can anyone help i want to call java class using visual basic

    I want to call java class using visual basic and send some arguments to the main class

    Hi,
    I don't know VB, but you can surely launch a command line like :
    javaw.exe mypackage.MyMainClass myArgument1
    Regards

  • Programmin​g Agilent N5242A throgh VISA command using LAN

    hi,
    I'm trying to program Agilent N5242A throgh VISA command using LAN with no success.
    The connection to the N5242a is working but when I'm using the visaWrite command it doesn't response.
    I used Agilent "connection Expert tool" and it worked.
    I tried to use Measurment & automation but there is no LAN option there, I have version 4.5.
    This is what I tried to do:
    status = viOpenDefaultRM (&defaultRM);
       if (status < VI_SUCCESS)
          printf("Could not open a session to the VISA Resource Manager!\n");
          exit (EXIT_FAILURE);
       /* Now we will open a session via TCP/IP to ni.com */
       //status = viOpen (defaultRM, "TCPIP0::ftp.ni.com::21:OCKET", VI_NULL, VI_NULL, &instr);
       status = viOpen (defaultRM, "TCPIP0::169.254.73.18::5025:OCKET", VI_NULL, VI_NULL, &instr);
       if (status < VI_SUCCESS)
          printf ("An error occurred opening the session to TCPIP0::ftp.ni.com::21:OCKET\n");
          viClose(defaultRM);
          exit (EXIT_FAILURE);
       viSetAttribute (instr, VI_ATTR_TCPIP_NODELAY, VI_TRUE);
      // status = viWrite (instr, "INIT:CONT ON", 13, &count);
          status = viWrite (instr, "*RST",4 , &count);
          status = viWrite (instr, "SENSe1:FREQuencyTARt 4000000000", 33, &count);
          status = viWrite (instr, "SENSe1:FREQuencyTOP 7000000000", 32, &count);
    Best Regards
    Israel
    Best Regards
    Boris

    TCPIP SOCKET (or SCPI-Raw) connection normally requires termination code (Line Feed, 0x0A) being sent, but not found in your viWrite() call.
    Write as like:
    status = viWrite (instr, "*RST\n", 5, &count);
    Also I think viPrintf() will be easier than viWrite() for ASCII write, because you dont have to specify the byte-length to send. Once you set buffer operation attributes like below:
    status = viSetAttribute( instr, VI_ATTR_WR_BUF_OPER_MODE, VI_FLUSH_ON_ACCESS);
    status = viSetAttribute( instr, VI_ATTR_RD_BUF_OPER_MODE, VI_FLUSH_ON_ACCESS);
    then you can now use viPrintf() like below:
    status = viPrintf( instr, "SENSe1:FREQuencyTOP %ld\n", (ViInt32)7000000000);

  • How do I open a pdf stored in a Microsoft Access database using Visual Basic studios 2012

    Currently I am unable to find a valid method of being able to open a pdf stored in a Microsoft Access database using Visual Basic studios 2012. I've tried displaying the entire database on a form, but when I do this all the other columns show up with
    the correct data besides the one containing the pdf's, it just displays <binary data> in each row down the column. I also tried another method with which you use the database as a dataset and can drag and drop the rows and columns into the form, which
    again works for all the other columns besides the one containing the pdf's but this time I'm unable to interact with the column  at all. 
    Not too sure if this is in the correct place, but any answers or help would be appreciated. Cheers.

    Alex,
    This forum is dedicated to Project and Project Server. You might get better response, if you post to a Visual Basic forum. Here are couple I could find. 
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vbgeneral%2Cvblanguage&filter=alltypes&sort=lastpostdesc
    Cheers,
    Prasanna Adavi, Project MVP
    Blog:
      Podcast:
       Twitter:   
    LinkedIn:
      

  • Can I use Visual Basic to covert form user data from multiple .pdf files to a single .csv file?

    Can I use Visual Basic to covert form user data from multiple .pdf files to a single .csv file?  If so, how?

    You can automate Acrobat using IAC (InterApplication Communications), as documented in the Acrobat SDK. Your program could loop through a collection of PDFs, load them in Acrobat, extract the form data from each, and generate a CSV file that contains the data.
    Acrobat can also do this with its "Merge Data Files into Spreadsheet" function, but this is a manual process.

  • How to access Oracle Data Base on Unix using Visual Basic ?

    Hi !
    I want to use visual basic and access the Oracle Data Base on Unix server. How can i do that ? Do i need any software?
    .Prashant

    You need an oracle client installation and setup your TNS names.

  • Need help creating full battery alert using visual basic script

    Hi,
    I have been searching for resources, programs and code that will create an alert for me to unplug my charger when my laptop
    battery is charged to full (or almost full).
    The only problem with this code is that
    Line 13: iRemaining (or RemainingCapacity called from BatteryStatus returns a 0 (might be a floating point which I can't figure out why). I even checked the microsoft documentation and its supposed to be a percentage.
    I want to get either the current percentage of the battery or the total Fullchargedcapacity and the EstimatedRemainingCapacity to find the % of battery level.
    Essentially what I am asking is how can I return the battery % using visual basic script.
    Help!
    The Code:
    1 set oLocator = CreateObject("WbemScripting.SWbemLocator")
    2 set oServices = oLocator.ConnectServer(".","root\wmi")
    3 set oResults = oServices.ExecQuery("select * from batteryfullchargedcapacity")
    4 for each oResult in oResults iFull = oResult.FullChargedCapacity
    5 next
    6
    7 while (1)
    8 set oResults = oServices.ExecQuery("select * from batterystatus")
    9 for each oResult in oResults
    10 iRemaining = oResult.RemainingCapacity
    12 bCharging = oResult.Charging
    12 next
    13 iPercent = ((iRemaining / iFull) * 100) mod 100
    14 if bCharging and (iPercent > 95) Then msgbox "Battery is at " & iPercent "%",vbInformation,"Battery monitor"
    15 wscript.sleep 30000 ' (30 seconds)
    16 wend

    14 if bCharging and (iPercent > 95) Then msgbox "Battery is at " & iPercent "%",vbInformation,"Battery monitor"
    On my Windows 7 machine your script returns the desired percentage (after adding the missing "&" to the right of "iPercent" in Line 14).

  • How do i detect DAQ device number programatticaly using Visual Basic (not using MAX)?

    how do i detect DAQ device number programatticaly using Visual Basic (not using MAX)?

    Several of the CWDAQ objects have Device (the device number), DeviceName, and DeviceType properties that I think will give you the information that you're looking for. For more information, look in the index of the Measurement Studio reference for Device, DeviceName, and DeviceType.
    - Elton

  • What replaced the LOAD command in Visual Basic 6?

    VB6 died with XP. I'm trying to re-write a VB6 app in Visual Studio Community. The VB6 project used the LOAD and UNLOAD commands to create and delete copies of text boxes on the form. How do I accomplish that with the latest version of Visual Basic under
    Visual Studio?
    Thanks,
    VBhobbist
    VBHobbyist

    Frank,
    [snip]
    I'm sure it can be done, but how can I learn without coming back to this forum with every little question?
    [snip]
    Hey, I will gladly be here for any questions.
    Public Class Form1
    'the new .NET manual is online now:
    ' - go to https://google.com
    ' - type 'msdn [keyword]' (i.e: 'msdn list')
    ' - the first result is almost what is desired
    ' - if not enough information is given that is what the forumns are for!
    'declaring array for textbox
    ' also note that -1 is the size, this is desirable so that textBoxes is initialized as an empty array so that when properties such as '.length' is used an exception wont be thrown saying the array is nothing
    ' note that some people prefer List(Of T) T means any type -> List is one of the most useful things in .NET and HIGHLY optimized. I did not use it here because it is an entirely new concept
    ' to learn more about list: http://msdn.microsoft.com/en-us/library/6sh2ey19(v=vs.110).aspx
    Private textBoxes(-1) As TextBox
    Private Sub setupTextBoxes()
    'setup the amount of textboxes you want
    ReDim textBoxes(14)
    'initialize an integer and loop thru the length of the array
    For delta As Integer = 0 To textBoxes.Length - 1
    'set current array position to a new object (note that the [TextBox class].New function will be called)
    textBoxes(delta) = New TextBox()
    'setup gui properties, note that as you are coding, the type will show up
    ' also note that when coding:
    ' x = New [type]
    ' it is similar to
    ' x = 0
    ' ^New Integer/String/Double/etc.
    textBoxes(delta).Size = New Size(100, 21)
    textBoxes(delta).Location = New Point(1, delta * 21)
    textBoxes(delta).Visible = True
    'note that all form objects that have a container can hold other form objects
    ' we add to the form
    Me.Controls.Add(textBoxes(delta))
    Next delta
    End Sub
    Private Sub getTextBoxStuff()
    'note that all variables can be initialized uppon declaration
    Dim strAllTextBoxes As String = ""
    'initialize an integer and loop thru the length of the array
    For delta As Integer = 0 To textBoxes.Length - 1
    'note that there are new operators (+=, -=, &=, etc.)
    'also, controlchars is the new way to use certain chars, and messagebox.show is the new msgbox
    strAllTextBoxes &= "TextBox " & delta.ToString & " = '" & textBoxes(delta).Text & "'" & ControlChars.CrLf
    'note: there are way more ways to concatenate strings now, for production you can benchmark each one for different purposes
    Next delta
    MessageBox.Show(strAllTextBoxes, "Form1", MessageBoxButtons.OK, MessageBoxIcon.Information)
    End Sub
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load '< Note that this is how subs are linked to gui elements now with the 'Handles' keyword
    'define a new button
    Dim btnGather As New Button
    'setup gui properties
    btnGather.Size = New Size(100, 21)
    btnGather.Location = New Point(110, 0)
    btnGather.Text = "Click Me"
    'add control to form, note that anywhere else, the button can be gathered again thru Me.Controls()
    Me.Controls.Add(btnGather)
    'add a handler, note that when typeing this, you can see what parameter types the handler needs
    AddHandler btnGather.Click, AddressOf btnGather_Click
    setupTextBoxes()
    End Sub
    Private Sub btnGather_Click(ByVal sender As Object, ByVal e As EventArgs)
    getTextBoxStuff()
    End Sub
    End Class
    Create a new Windows Form project and paste this, press play.
    Enjoy.
    EDIT:
    If you post blocks of code here, I will personally convert it to .NET, although I highly recommend a creating new project when converting from VB6. If you post your entire project and it's not too big I will convert the entire thing (any complex concepts
    will have to have provided comments).
    If your project is not secure or personal you can copy it to your online cloud OneDrive and I can download the whole thing from there - let me know.

  • Has anyone used Config_DAQ_Event_Message using Visual Basic?

    I am not using ComponentWorks, just Visual Basic 6.0 on Windows NT with DAQ dll function calls. My hardware is an PCI-6534. The function Config_DAQ_Event_Message has as its last parameter a callback function address. I prefaced the function name with AddresOf. I can't get the code to call the specified function? I don't know the format of the callback function...parameters, returned value, etc. Does anyone have an example?

    I've had the same problem for a 6527 device.
    The solution is not available anymore on this forum but I've still have the example.
    The problem is that VB doesn't use the same adressing than C++.
    But you can use WM_MOUSEMOVE command for "message", EventSinkForm.hWnd for "handle" and 0 for "callback address", if you use the example joined.
    It works.
    Attachments:
    6527example.zip ‏3 KB

  • How to compare two PDFs using Visual Basic

    Hi,
    We have created one Visual Basic exe for comparing two PDFs.We are using AcroExch.App and AcroExch.avDoc
    for creating adobe application object. And we are using MenuItemExecute "DigSig:ToolsDiff" for comparing the PDFs. This piece of code is working fine with Adobe 4.0 and it is comparing the PDFs and showing the mismatches.
    But the same piece of code is not working with Adobe 8.0 Professional. Is there any similar command to MenuItemExecute "DigSig:ToolsDiff" in Adobe 8.0 to find out the mismatches or any alternate approaches that i can try to make the existing code works properly to see the mismatches between two PDFs.
    Thanks in advance,
    Raju

    The only APIs for comparing PDFs are part of the plugin APIs, and not exposed to COM/IAC. You would need to write a custom plugin that called the APIs directly and then expose your plugin for use via VB.
    Leonard

  • How to read an APO table from excel in place using Visual Basic ?

    We have enhanced some APO reports using layouts that use excel in place with custom visual basic (VB) code. For example, the VB code can append the data with additional columns that perform specific calculations and then proceed to create pivot table reports in excel..That is working fine.
    The challenge is to see if that VB code could read specific APO tables (e.g. product master tables) to bring additional elements into excel and thus expand the report content. We know that additional fields can be added to the reports, but having the flexibility to read tables from VB could be more flexible.
    Can that be done?. If so, would it be possible using exclusively the VB code attached to the layout, i.e. no ABAP?

    Hello Anselmo,
    I am assuming you are doing this either using BeX analyzer or by reading the planning book using the RFC ActiveX component and a BAPI.
    I think it's possible to retrieve the data from the product master table. Here are my thoughts on how can this be done:
    1) You can create a generic datasource (transaction RSO2) for the product master table, connect that to a BW remotecube and use a BeX query to retrieve that values. You can then join the queries using VBA. Alternatively, you can build a muti-provider that connects your current InfoCube to the new RemoteCube and build a query from there. The multi-provider, in this case, joins the data (no more VBA).
    2) If you have already loaded your product master data into master data carrying InfoObjects then you can try the same technique as #1 but this time there is no need to create the generic datasource. You can use the InfoObjects for your master data as the InfoProviders for your query.
    3) You can try the ActiveX component from SAP which can  connect to any emote enabled function in SAP system. SAP already provided some BAPIs (check transaction BAPI for a list) which might be able to provide the data. You can also create your own function modules (be sure to make it remote enabled) using ABAP. (transaction SE37).
    Hope this helps

  • Can i use visual basic 2010 console mode or later versions on a macbook?

    hello. i want to buy a macbook but i am taking computer classes that require visual basic 2010 console mode or later versions. Can i use this on a macbook or does it work only on windows' laptops?

    Sometimes they do work - i've done it before.  I have a late 2008 Macbook Uni and used the install dvd of my 2009 Macbook White and it worked.
    Why not just clone your hard drive?  It'll save you a lot of time doing a clone rather than doing a clean install.
    Unless you're having issues with your old set up or  your old hard drive is dead.
    You can download Carbon Copy Cloner - install your new hard drive in a external usb enclosure (around $10) and clone fromt here then test it before you install it in your Macbook.
    Once you've done the swap, you can install your old hard drive in the USB enclosure and use it as a backup drive.
    Good luck

  • How do I read in from a Lab-PC+ card using Visual Basic?

    I have a Lab-PC+ card installed and hooked up to a number of pressure trasnducers etc. I want to read the data in using VB but I've heard that VB cannot interface to I/O without some extraq bits of software.

    While your data acquisition programming in Visual Basic will be easier and faster with our Measurement Studio product, you are not restricted to using it. You can simply make calls into the NI-DAQ driver DLL. Take a look at the first Knowledge Base article I have linked below for information on installing NI-DAQ examples for VB. You will be interested in the second paragraph which describes how to install examples from the driver.
    How Do I Install the DAQ Example Programs for VB and VC?
    http://digital.ni.com/public.nsf/websearch/67B97D1BADB40A4186256C7500770847?OpenDocument
    As for the API into the driver DLL, you will need the NI-DAQ Function Reference Manual, which I have also linked below.
    NI-DAQ Function Reference Manual for PC Compati
    bles
    http://digital.ni.com/manuals.nsf/websearch/1630A0B68738B269862567C1007A2912?OpenDocument&node=132100_US
    Regards,
    Justin Britten
    Applications Engineer
    National Instruments

  • How to suppress Compare documents dialog in Acrobat 8 using Visual Basic

    Hi,
    We are having one utility developed in VB and we are using this to compare PDF documents with Adobe 8.0.
    Before comparing the PDFs,first Compare Documents dialog is displayed and then we have to say OK. Then,
    mismatches between the documents is shown. I want to suppress the Compare dialog box and is there anyway
    in VB to suppress the compare dialog and to click on OK programmatically.
    Thanks for your Help in advance.
    Raju

    No there is nothing in the API that allows you to automate the pushing of buttons in the UI. You could try and use something like SendKeys to see if it worked but a word of warning. Doing so would be a real HACK and totally unsupported.
    Sabian

Maybe you are looking for

  • Can't open pdf attachments from Mail

    When I'm in Mail and try to open or save to my computer and then open a pdf in Preview, I get an error message  - "The file "Proposal to Seattle City Light - Wolverine Study 6Mar2012.pdf" could not be opened.  It may be damaged or use a file format t

  • Doutb in table control

    hi all i am doing table control in that when the quantiy field  is zero the field should be output only enabled otherwise it should be input enabled ... how to go about ... thanks in advance lokesh

  • How to stop process flow?

    Hi there. I have oracle 9i + OWB 10.1..2. During last changes on the server (AIX) there was a problem with starting JServer. I didn't seem to be problem until I wanted to user Workflow Monitor. Obviously it didn't work. My question is: how to stop a

  • How To Fix View Options for a Specific Folder

    I have several folders that I prefer to view in specific ways: Applications in list view, alphabetically, with large icons; another also in list view, by most recently modified, also large icons; another in icon view, with icons set to a specific siz

  • Wow Wireless Headset Mic stops working on Mac OSX 10.6.3

    I'm running the April drivers and firmware for my wireless wow headset. After the install of the drivers all was working great. No lag from mic etc. I shutdown my computer went to bed. Next day I booted up, worked a bit and then turned on my headset.