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);

Similar Messages

  • 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,

  • How can I read the trace data from Agilent(HP​)8510C in C++ using NI488.2 and PCI-GPIB ?

    Hello! I am trying to develop an application in C++ for measurements with Agilent(HP) 8510C network analyser using NI488.2 and National Instrument's PCI-GPIB card. In HPBASIC the trace data is read using OUTPDATA command which contains PREAMBLE, SIZE and then the data string in real and imaginary pair for the required points. The ibrd function gives data only for one point. Kindly guide me how I can read the whole trace and and separate out the real and imaginary data values. Regards, kapil

    Hey Kapil,
    It seems that in HPBASIC you were using an instrument driver for the 8510C. OUTPDATA is not a native HPBASIC function. National Instrument has similar instrument drivers for LabVIEW and CVI.
    http://zone.ni.com/idnet97.nsf/9b2b33e1993d8777862​56436006ec498/7b235254f3881ddb862568ab005fbd2e?Ope​nDocument
    http://zone.ni.com/idnet97.nsf/9b2b33e1993d8777862​56436006ec498/24ca7db880ab78ae862568ab005fbc0f?Ope​nDocument
    For example in the CVI instrument driver you will find a source file called hp8510.c. In the source code you will find a function called hp8510c_dataInRaw that sounds similar to the function that you described.
    Note that this example is designed for CVI, but it is possible that you could extract the information you need for C++. If
    you had a copy of CVI you could just add the files downloaded from the instrument driver to a project and then compile and run the project. It already contains a ready to run example that allows you to capture data and use your instrument.
    If you want try CVI you can download an evaluation copy on-line at http://ni.com/lwcvi/launch.htm.
    I hope this helps out,
    JoshuaP
    National Instruments

  • Error while generating DDL commands using startSQLRepository for a new Repository

    Hi,
    I am trying to generate DDL Commands using startSQLRepository for my new repository SubashRepository so that I can use them to create new table structure.
    All the repository related changes looks good. i can see my repository in ACC
    When I run the command:
    startSQLRepository -m SupremeATG –repository /com/supreme/SubashRepository /com/supreme/subashRepository.xml -outputSQLFile C:/ATG/ATG9.3/SupremeATG/config/com/supreme/subashRepositoryDDL.txt
    I get following error:
    Table 'SUBASH_MEMBER' in item-descriptor: 'member' does not exist in a table space accessible by the data source.  DatabaseMetaData.getColumns returns no columns
    Note:
    * errors related to definition file were cleared as the same command threw relevant exception while trying to store a array property with out creating a multi table.
    * Now this is the only exception i see
    * Some DDL are getting generated in the output file, but those are related to inventory repository (I am not sure why this is happening as I have specifically gave the path to my definition file).
    Any help in resolving this is highly appreciated.

    Pl post in the ATG forum

  • Running unix command using java shows error

    Hi All,
    I am trying to run UNIX move command using Java exec method but its throwing error, unable to rename. Here below is the code i am trying to run to move all files from one directory to another directory. source and destination directory exists.
    public class Demo
        public static void main(String args[])
            try
                Runtime rt = Runtime.getRuntime();
                Process proc = rt.exec("mv /home/demo1/* /home/demo2");
                int exitVal = proc.waitFor();
                System.out.println("Process exitValue: " + exitVal);
            } catch (Throwable t)
                t.printStackTrace();
    }if i give "mv /home/demo1 /home/demo2" in exec method, its working, with * character its giving problem.
    Please help me in resolving the problem.
    Thank you

    Characters like *, >, &, |, etc. are interpreted by the command shell--that is by the bash, zsh, etc. programs. When you execute a command with ProcessBuilder or Runtime.exec, you're not going through one of those shells, so their interpretation of those characters is not available.
    In your code, the character * is being delivered directly to the mv command (which doesn't think * is anything special), as opposed to being turned into a list of files and directories as it would be when it's interpreted by the shell. The mv command doesn't know anything about the * character being special.
    If you want to have those shell interpretations, you need to execute the command through a shell. One example is like so, but a) you'll want to read up on the methods in exec() that take arrays of String, and b) you'll want to read up on ProcessBuilder, and c) you'll need to check your shell's man pages to see the exact syntax and arguments.
    runtime.exec("/bin/bash -c 'mv x/* y'");

  • Running 5 commands using array elements and waiting between?

    Hi All,
    Trying to learn PS so please be patient with me ;)
    System: PSv3 on Win2012 server running WSUS role
    I am wanting to execute 5 commands using a 'foreach' loop but wait until one finishes before moving onto the next. Can you please check out what I have and provide some suggestions of improvement? or scrap it completely if it's rubbish :(
    Current code:
    #### SCRIPT START ####
    #Create and define array and elements
    $Array1 = @(" -CleanupObsoleteComputers"," -DeclineSupersededUpdates -DeclineExpiredUpdates"," -CleanupObsoleteUpdates"," -CleanupUnneededContentFiles"," -CompressUpdates")
    #Run the cleanup command against each element
    foreach ($element in $Array1) {
    Get-WsusServer | Invoke-WsusServerCleanup $element -Whatif
    #### SCRIPT END ####
    I am assuming that I need to use @ to explicitly define elements since my second element contains two commands with a space between?
    The cleanup command doesn't accept '-Wait' so I'm not sure how to implement a pause without just telling it to pause for x time; not really a viable solution for this as the command can sometime take quite a while. They are pretty quick now that I do
    this all the time but just want it to be future proof and fool proof so it doesn't get timeouts as reported by others.
    I have found lots of code on the net for doing this remotely and calling the .NET assemblies which is much more convoluted. I however want to run this on the server directly as a scheduled task and I want each statement to run successively so it
    doesn't max out CPU and memory, as can be the case when a single string running all of the cleanup options is passed.
    Cheers.

    Thank you all for your very helpful suggestions, I have now developed two ways of doing this. My original updated (thanks for pointing me in the right direction Fred) and Boe's tweaked for my application (blew my mind when I first read that API code
    Boe). I like the smaller log file mine creates which doesn't really matter because I am only keeping the last run data before trashing it anyway. I have also removed the verbose as I will be running it on a schedule when nobody will be accessing it anyway,
    but handy to know the verbose commands ;)
    Next question: How do I time these to see which way is more efficient?
    My Code:
    $Array1 = @("-CleanupObsoleteComputers","-DeclineSupersededUpdates","-DeclineExpiredUpdates","-CleanupObsoleteUpdates","-CleanupUnneededContentFiles","-CompressUpdates")
    $Wsus = Get-WsusServer
    [String]$Logfile = 'C:\Program Files\Update Services\LogFiles\ArrayWSUSCleanup.log'
    [String]$Logfileold = 'C:\Program Files\Update Services\LogFiles\ArrayWSUSCleanup.old'
    If (Test-Path $Logfileold){
    Remove-Item $Logfileold
    If (Test-Path $Logfile){
    Rename-Item $Logfile $Logfileold
    foreach ($Element in $Array1)
    Get-Date | Out-File -FilePath $LogFile -Append -width 50
    Write-Output "Performing: $($Element)" | Out-File -FilePath $LogFile -Append -width 100
    . Invoke-Expression "`$Wsus | Invoke-WsusServerCleanup $element" | Out-File -FilePath $LogFile -Append -width 100
    Logfile Output {added 1 to show what it looks like when items are actions}:
    Wednesday, 27 August 2014 2:14:01 PM
    Obsolete Computers Deleted:1
    Wednesday, 27 August 2014 2:14:03 PM
    Obsolete Updates Deleted:1
    Wednesday, 27 August 2014 2:14:05 PM
    Expired Updates Declined:1
    Wednesday, 27 August 2014 2:14:07 PM
    Obsolete Updates Deleted:1
    Wednesday, 27 August 2014 2:14:09 PM
    Diskspace Freed:1
    Wednesday, 27 August 2014 2:14:13 PM
    Updates Compressed:1
    Boe's Updated Code:
    [String]$WSUSServer = 'PutWSUSServerNameHere'
    [Int32]$Port = 8530 #Modify to the port your WSUS connects on
    [String]$Logfile = 'C:\Program Files\Update Services\LogFiles\APIWSUSCleanup.log'
    [String]$Logfileold = 'C:\Program Files\Update Services\LogFiles\APIWSUSCleanup.old'
    If (Test-Path $Logfileold){
    Remove-Item $Logfileold
    If (Test-Path $Logfile){
    Rename-Item $Logfile $Logfileold
    [Void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
    $Wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer($WSUSServer,$False,$Port)
    $CleanupMgr = $Wsus.GetCleanupManager()
    $CleanupScope = New-Object Microsoft.UpdateServices.Administration.CleanupScope
    $Properties = ("CleanupObsoleteComputers","DeclineSupersededUpdates","DeclineExpiredUpdates","CleanupObsoleteUpdates","CleanupUnneededContentFiles","CompressUpdates")
    For ($i=0;$i -lt $Properties.Count;$i++) {
    $CleanupScope.($Properties[$i])=$True
    0..($Properties.Count-1) | Where {
    $_ -ne $i
    } | ForEach {
    $CleanupScope.($Properties[$_]) = $False
    Get-Date | Out-File -FilePath $LogFile -Append -width 50
    Write-Output "Performing: $($Properties[$i])" | Out-File -FilePath $LogFile -Append -width 100
    $CleanupMgr.PerformCleanup($CleanupScope) | Out-File -FilePath $LogFile -Append -width 200
    Logfile Output {added 1 to show what it looks like when items are actions}:
    Wednesday, 27 August 2014 2:32:30 PM
    Performing: CleanupObsoleteComputers
    SupersededUpdatesDeclined : 0
    ExpiredUpdatesDeclined    : 0
    ObsoleteUpdatesDeleted    : 0
    UpdatesCompressed         : 0
    ObsoleteComputersDeleted  : 1
    DiskSpaceFreed            : 0
    Wednesday, 27 August 2014 2:32:32 PM
    Performing: DeclineSupersededUpdates
    SupersededUpdatesDeclined : 1
    ExpiredUpdatesDeclined    : 0
    ObsoleteUpdatesDeleted    : 0
    UpdatesCompressed         : 0
    ObsoleteComputersDeleted  : 0
    DiskSpaceFreed            : 0
    Wednesday, 27 August 2014 2:32:34 PM
    Performing: DeclineExpiredUpdates
    SupersededUpdatesDeclined : 0
    ExpiredUpdatesDeclined    : 1
    ObsoleteUpdatesDeleted    : 0
    UpdatesCompressed         : 0
    ObsoleteComputersDeleted  : 0
    DiskSpaceFreed            : 0
    Wednesday, 27 August 2014 2:32:36 PM
    Performing: CleanupObsoleteUpdates
    SupersededUpdatesDeclined : 0
    ExpiredUpdatesDeclined    : 0
    ObsoleteUpdatesDeleted    : 1
    UpdatesCompressed         : 0
    ObsoleteComputersDeleted  : 0
    DiskSpaceFreed            : 0
    Wednesday, 27 August 2014 2:32:38 PM
    Performing: CleanupUnneededContentFiles
    SupersededUpdatesDeclined : 0
    ExpiredUpdatesDeclined    : 0
    ObsoleteUpdatesDeleted    : 0
    UpdatesCompressed         : 0
    ObsoleteComputersDeleted  : 0
    DiskSpaceFreed            : 1
    Wednesday, 27 August 2014 2:32:43 PM
    Performing: CompressUpdates
    SupersededUpdatesDeclined : 0
    ExpiredUpdatesDeclined    : 0
    ObsoleteUpdatesDeleted    : 0
    UpdatesCompressed         : 1
    ObsoleteComputersDeleted  : 0
    DiskSpaceFreed            : 0

  • What are the commands using in SAP ECC 6.0 ehp on SYBASE Database? Backup and restore commands?

    Hi All,
    What are the commands using in SAP ECC 6.0 ehp on SYBASE Database? Backup and restore commands?

    Hi Jayachander,
    Have a look at these sap notes:
    For taking backup: Schedule from DB13 and get the exact command from Logs
    1841993 - SYB: How to schedule backups in DBA Cockpit
    1887068 - SYB: Using external backup and restore with SAP Sybase ASE
    How to restore DB
    1611715 - SYB: How to restore a Sybase ASE database server (Windows)
    Divyanshu

  • Re: Error while Execute External Operating System Command using T.code SM49

    Dear Experts,
    I Have uploaded one .exe file in the application server (eg: sum.exe) and created the OS command in SM69 transaction .
    And maintained the application server path in the 'operating system command' field in SM69 t.code.
    Our SAP system, oprating system is UNIX.
    After I have executed the external command using transaction SM49 , but I got the below error.
    Can not execute external program (permission denied) , External program terminated with exit code 1
    Immediately I run the SU53 transaction code to check the authorization, but Authorization was successful.
    Could any one please help on this error.
    Thanks in advance.

    >>Can not execute external program (permission denied) , External program terminated with exit code 1
    You need to give the permission as 755 to your file.
    >>I Have uploaded one .exe file in the application server (eg: sum.exe)
    You are on UNIX and do not expect to any result of .exe file as UNIX doesn't know about this.

  • Image won't open after right click and "open with" command using Editor PSE 10

    Can't see image after right click and "open with" Windows XP command using Editor PSE 10. The editor opens but no image appears. I have to use the open command from within Editor

      Make sure you have chosen the application PhotoshopElementsEditor.exe and not a shortcut.
    To manually associate a file format with an application:
    In Windows Explorer, right-click a file whose file association you want to change. For example, if you want to change the file association for all jpeg files, click a jpeg file.
    Choose Open With > Choose Program from the pop-up menu.
    In the Open With dialog box, click Browse and then locate and select the exe application file.
    Checkmark "Always use the selected program to open this kind of file" and click OK.
    Note:If you choose a program from the Open With menu in step 2, instead of selecting the Choose Program option, this check box is not available, and the file association won't work.

  • Run a shell command using Pl/Sql

    hi all
    i wonder if anyone knows a way to run a shell command using pl/sql
    other than java stored procedure
    as it seems not to be working in my case
    thanx in advance,
    Rasha

    ofcourse not
    i sent it once then i've got disconnected from interent then i reconnected
    and resend my question so it was sent twice
    now i hope you can answer my question !!!
    Do you really think when asking twice or more often you will get a quicker answer?

  • What is '$sync' command use for?

    Hi everybody.
    I'm just curious about what is '$sync' command use for?
    what happend if I use that command?
    and what kind of purpose to use this one?
    and how can I search forum using special character like '$' or '#' '&' .
    seems searching doesn't work when I tried with that character.
    can someone give me a hint?
    thanks for your help

    Hello inchul,
    This link will explain what problems could arise:
    http://help.sap.com/saphelp_47x200/helpdata/en/c4/3a6f8f505211d189550000e829fbbd/frameset.htm
    Regards,
    Siddhesh

  • Execute unix command using java

    Hello
    Can we execute a unix command using java? If it is how we can execute. Is this affect the performance of the program.
    Thanks

    I tried what you said. But its not working and returning error message,
    java.io.IOException: CreateProcess: ls -a error=2
         at java.lang.ProcessImpl.create(Native Method)
         at java.lang.ProcessImpl.<init>(Unknown Source)
         at java.lang.ProcessImpl.start(Unknown Source)
         at java.lang.ProcessBuilder.start(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
    If i try this statement,
    Runtime.getRuntime().exec("c\windows\notepad");
    It is working fine.
    Any idea about this.
    Plz ...........

  • To execute external command using   RFC_REMOTE_exec

    Hi
    i want to execute the ext command using RFC_REMOTE_EXEC .
    i have used like below in WINDOWS XP:
    data: v_cmnd(120) type C VALUE 'dir C:\SAP\rfcsdk\bin >RFEXEC -D ESM_R'.
    call function 'RFC_REMOTE_EXEC' destination D_DESTI
    exporting
    command = v_cmnd
    exceptions
    system_failure = 1 message D_ERMSG
    communication_failure = 2 message D_ERMSG.
    manually at command line the program getting registerd but
    not throuergh RFC_REMOTE_EXEC 
    in v_cmnd  what is the exact value we have to give
    Regards

    you create the command in SM69 with some name and Directly give the Same name when you are executing.
    Check this Function also.
    SXPG_COMMAND_EXECUTE

  • Controling wheelchair by speech command using Neuron Network in labview

    Hi all,
    I'm doing project about "controling wheelchair  by speech command using neuron network in labview". I found some informations about controling whelchair combine with function microsoft speech recognition in window or something like that but this was not my point. So, I have some question about that:
    1) How do I store the command "Left-Right-Back-Go-Stop" in labview. After that, analyzing to find the differences of characteristic of these command.
    2) Based on these characteristic above, using neuron network to find exactly command.
    Are there anyone do like this before? I need all help from you.
    Thank you so much.

    Greetings;
    First, it is most excellent that you have gotten to where you can compare the words being said to the sample.
    If I understand correctly, you are interested in continuously acquiring sound, saving it and then comparing it with the sample? That is not as straightforward as it sounds simply because it would be difficult to realize when there is sound in the first place and when that sound is relevant. 
    I would probably start by figuring out whether there is or not sound by comparing the microphone input to a certain threshold, saving if there is sound, and then halting the recording when the sound stops. It would be then that you would compare with your samples via the algorithm that you have made.
    In order to check for volume, I came across the following example:
    http://zone.ni.com/devzone/cda/epd/p/id/2150
    It was mentioned in the following discussion:
    http://forums.ni.com/t5/LabVIEW/Microphone-Input-Detection/td-p/487367
    Cordially;
    Simon P.
    National Instruments
    Applications Engineer

  • What commands used for taking backup of oracle database using BR*Tools

    Can somebody please help me urgently to know what are the commands used for taking backup of oracle database using BR TOOLS.Also specifythe commands in detail which can be used for taking backups of oracle database ,Online Redo log files in databse using BRBACK tool,Archiving of offline, redo log files using BRARCHIVE, and Restoring a Database using BRRESTORE tool Commands(Plese specify the commands with their Syntax used).Also specify the commands with their Syntax which are used for taking backup of oracle database(online,Offline redo log files) into Tapedrives using BRTOOLS commands.
    Thanking You for helping (in advance).

    Dear Ashish,
    BRBACKUP / BRARCHIVE calls the operating system command to copy the files.
    Simple approach to get the commands is as follows.
    1. Set the BR_TRACE (as given in the SAP note 29321) and run the command for which you need to know the OS / SQL commands.
    2. This will generate the log file with the trace information. This trace has the information of the commands used by the job you have run.
    Hope this helps.
    Regards,
    Madhukar

Maybe you are looking for

  • Setting Canvas Background Color issue

    For some reason I cannot set a color for my canvas background. I have tried using setStyle('backgroundColor', colorNumber); in actionscript and setting directly in the mxml with no success. It only takes the value that is set in the design mode of Fl

  • How to make a header in a table non-scrollable even when u use scollbar

    i'm adding the table to scrollpane and this scrollpane is added to the container using border layout in Center and using .gettableHeader() i'm adding this to the container in north.now the problem is when ever i scroll table data using scrollbar(vert

  • Designer 6i Release 2 makes Oracle 8.1.7 installation impossible!!!

    Hi, Designer 6i Release 2 makes Oracle 8.1.7 installation impossibleon Windows 2000 Server!!! After I uninstalled Designer 6i Rel2 through the Oracle Installer and then manually deleted all the left directories and Oracle registry entries I found HKE

  • Is there a fix for Safari crashing with OS 5.0.1

    After installing OS 5.0.1, my ipad crashes ramdomly. I know some of the websites use javascript and youtube.This is not a flash problem.

  • RTMFP vs. RTMP for data application

    I have a scenario and I'm trying to determine which is the best protocol to use. We have a server running FMS 4. We want 1-50 'admin' client connections to the 'admin' application on the FMS We want 50-10000 'user' client connections to the 'particip