Sr400 scanning gate mode

Hello Forum,
                   Some of the problems I've encountered using the sr400 gated photon counted have been commented on here before (e.g.. It often hangs up while waiting for the RSI, and that this can be more or less solved by removing this request.)
                   A problem that noone else has discussed is using it in scanning gate mode. I have attached two programs one with the RSQ and one without) that ask the counter A to scan. As I understand from the manual, this means that for every count period the delay before the gate opens should increase by a user-determined increment. 
                     There is first a question of stability, in that the program doesn't always work. Sometimes the photon scnnaer scans, sometimes it doesn't. However, on the occasions that it does tell me it is scanning, I see no evidence of this in the results. Since I'm scanning through a modulated signal (a square wave), the scan should reproduce this result. Instead, all I get is a straight line.
                       If one has the time, can they look through the program and tell me whether there is a serious issue with it or whether the problem should be put down to the age and stability of the photon counter. The programs are a lightly modified version of one posted by a forum easier, which apart from the problem with scanning, works more or less okay.
Thanks,
            L
Attachments:
MOD2_photoncounter_ss.vi ‏61 KB
MOD2_photoncounter_es.vi ‏65 KB
Wait.vi ‏11 KB

Hi Luiz,
I saw your code and note you didn´t configure the serial port, maybe you need configure a better baud rate to work with this device.
regards,
Abel Souza
Engenheiro de Aplicações
National Instruments Brasil

Similar Messages

  • Error 2147138480 in Set Scan Engine Mode to Actif

    Hi all,
    I'm fighting in front of this error which occur and does not want to go away (even after trying everything)...
    The error (-214713840) is happening when trying to set back the Scan Engine Mode to actif.
    It says: "The slave device could not be found. The positional addresses within the LabVIEW project are inconsistent with the actual network topology. [...]"
    I was trying to program the detection of the loss of a CompactRIO chassis when this error first occurr.
    I have 2 CompactRIO "EtherCAT" connected to a RT computer.
    Thanks for all the help or suggestion you can provide me ;-)
    Cheers,
    Laurent

    Hi Laurent,
    I don't know if your problem has been solved but I prefer asking.
    Are you sure of the error code you encounter ? I don't find it in the manual or other places.
    Regards,
    Mathieu P. | Certified LabVIEW Associate Developer
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    Journées techniques : des fondamentaux aux dernières technologies pour la mesure et le contrôle/comm...

  • Scan interface mode erreur -805

    Bonjour,
    Je suis débutant de système Compact RIO. J'ai quelques questions sur le scan interface mode.
    Le matériel que j'utilise est 
    le contrôleur cRIO-9012 et chassis cRIO-9101 intégré
    une carte AI 9205
    une carte DIO 9401
    Je voudrais utiliser le scan interface mode pour comprendre le fonctionnement des cartes, dans le FPGA interface mode, ça prend du temps pour la compilation.
    Le chassis ne supporte pas le scan interface mode, alors je configure les 2 cartes individuellement en utilisant les I/O variables. Ensuite je crée un VI tout simple pour lire la tension de la carte AI. J'obtient une erreur -805 : Timing source ,synchroniser avec le moteur de balayage.
    J'ai vérifié aussi dans MAX, le soft  NI scan Engine est bien installé.
    Quelqu'un pourrait me dire d'où vient ce problème?
    Merci d'avance.
    Lily
    Solved!
    Go to Solution.
    Attachments:
    scan interface mode.zip ‏22 KB

    Bonjour,
    Erreur -805
    est relatée à un bug dans la version localisée de LabVIEW.
    LabVIEW Stops Execution After Synchronizing With Scan Engine :
    http://digital.ni.com/public.nsf/allkb/81977F8BE19​2C7C48625754C0075D93E?OpenDocument
    Erreur
    -66205 peut être un résultat de l'erreur précédente, mais aussi parce que les
    variables partagées ne sont pas déployées (correctement). 
    Comme expliquer dans l'article proposer par « speleato »
    (http://digital.ni.com/public.nsf/allkb/122E971F52F​D081A86257500007A046C), vous
    devez compiler et exécuter le « Blanc VI » du FPGA enfin the déployée la
    logique nécessaires pour le « scan mode », utilisant la fonction « Open
    FPGA VI Reference » dans le « test 9205.vi ».
    Le moment
    que la logique est déployée, l'erreur doit être disparue.
    ENGLISH :
    Error -805 is related to a bug in the localized versions of
    LabVIEW.
    LabVIEW Stops Execution After Synchronizing With Scan Engine :
    http://digital.ni.com/public.nsf/allkb/81977F8BE19​2C7C48625754C0075D93E?OpenDocument
    Error -66205 can be a result of the previous error, but more
    likely it is because the shared variables are not deployed (correctly).
    As explained in the article refered by « speleato » (http://digital.ni.com/public.nsf/allkb/122E971F52F​D081A86257500007A046C),
    you need to compile and execute the « blanc VI » on the FPGA target
    to deploy the needed « scan mode » logic, using the "Open FPGA VI
    Refernce" function in the "test 9205.vi".
    Once this is done, the error should have been gone.
    Best regards,
    Joeri
    National Instruments
    Applications Engineering
    http://www.ni.com/ask
    Make our forums great:
    If you like the answer, don't forget to "Kudos!".
    "Accept the Solution" if your question is answered!

  • Crear PWM con CompaqDaq o CompaqRIO (Scan interface mode solamente)

    Que tal amigos.. Estoy realizando un proyecto en el cual es necesario enviar ya sea digital o analógica una señal PWM pero a altas velocidades.Requiero que la frecuencia máxima sea de 200kHz. Lo he intentado de diferentes maneras pero lo mas veloz que he obtenido son 500Hz. Tambien dispongo de un CompaqRIO 9074 y si pudieran ayudarme de igual forma con este chasis estaría de lujo, solo que también lo he intentado pero no me da los resultados deseados y mas aun porque no estoy familiarizado con la programación en FPGA solo con scan interface mode.
    ¡Resuelto!
    Ir a solución.

    Que tal Reno32
    Trabajando en Scan Interface:
    Dentro de los ejemplos de LabVIEW, viene un proyecto que podemos utilizar como referencia para trabajar con salidas PWM en Scan Interface. Dentro de LabVIEW, seleccionamios Help >> Find Examples y en la pestaña de Search buscamos por la palabra 'PWM'. Hay un proyecto en particular que me gustaría que revisara, el cual se llama "NI 94xx - Pulse Width Modulation - Scan Mode.lvproj". Particularmente este ejemplo lo podemos utilizar para trabajar con un chasis cRIO 9074 y cualquier modulo NI 94xx. Dentro de este proyecto, las salidas digitales de un modulo NI 9401 se configuran como PWM. De hecho si damos click derecho sobre el modulo con el que estemos trabajando, y vamos a Properties, podemos seleccionar que queremos trabajar la salida digital como PWM, y podemos seleccionar la frecuencia a la que deseamos generala. 
    La máxima frecuencia que podemos alcanzar, trabajando en Scan Mode es de hasta 20 kHz. Dentro de este proyecto, viene el código utilizado para trabajar con estas salidas PWM, que quizá nos pueda servir de referencia. 
    Trabajando en FPGA:
    Ahora bien, si deseamos alcanzar velocidades más altas, esto lo podemos lograr bajandonos a configurar el FPGA de nuestro cRIO. De igual forma, dentro de Help >> Find Examples, buscando en la pestaña Search por 'PWM', hay un proyecto titulado "PWM Generation.lvproj" el cual nos puede servir de referencia para configurar con salidas PWM configuradas directamente desde el FPGA. De igual forma, le comparto el 'Getting Started with CompactRIO and LabVIEW', en donde viene una sección de 'Creating a PWM Loop', en donde vienen los pasos sobre como crear una salida PWM configurarada directamente en el FPGA. 
    Getting Started with CompactRIO and LabVIEW
    http://www.ni.com/pdf/manuals/372596b.pdf
    Espero que esta información le resulte útil. Puede explorar las dos opciones y decidir cual forma de trabajar se adecúa mejor a su aplicación. 
    Un saludo !
    Omar R.
    Applications Engineer

  • How do i reset a counter in crio scan interface mode

    Hai,
         I am using cRIO 9104 with NI 9421(DI SINKING) module for my counter application in scan mode.
    I have a doubt that how do i reset my counter previous value when my system is in idle mode(i.e stable mode).I tried to use a timeout in property node, But i am not able to put a timeout in my code ,herewith I have attached the printscreen of my program.You can see the timeout option is in hide mode.Any other option is there to reset a counter.Kindly solve this problem and let me know the details.
    Thanks and Regards
    Jayanthi.K
    Attachments:
    Untitled.png ‏292 KB

    You need to get a refnum for the module.  The simplest way to do this is to drag the module in the project onto your block diagram.  It will drop a refnum constant for the module.  You will find all kinds of useful properties and methods on this refnum.  In this case the refnum is of a class named "SD Module" (where "SD" stands for "Specialty Digital") and it has a method on it for resetting counters.  See the attached screenshot of the block diagram.
    Ross Houston
    Senior Software Engineer
    RIO Software R&D
    Attachments:
    reset_counter.png ‏3 KB

  • Digital ICE epson scan (professional mode) does not work

    Hello,
    I am running the latest Mountian  Lion OS on my IMAC and have recently started running some test scans with  my Epson Perfection V700 scanner. The supplied Epson software , Epson Scan offers a variety of operating modes, "professional mode" offering the most features. Professional mode offers Digital ICE as an option, however when selected, the Digital ICE does not work.I have compared scans with  and without digital ICE and they are exactly the same. Scratches and dirt are not removed by the scan.
    If I select a more basic mode ("Home Mode") Digital ICE does  work. But this other mode does not offer the range of options offered in porfessional mode.
    Has anyone out there used Epson Scan software?  Has anyone else experienced this problem? Is there other scanning software out there which could fully exploit the features of the Epson scanner I have?  I tried Vuescn and it does not seem to be compatible with my scanner, so that is off the table.
    Dean

    You should first read the user manual that came w/your scanner and/or contact Epson tech support.
    How is the scanner connected to your iMac?  USB cable?  Wireless?  Firewire?
    Has anyone out there used Epson Scan software?
    I have an Epson scanner.  It only work when it's connected directly to my iMac via USB cable.
    Has anyone else experienced this problem?
    Initially.
    Is there other scanning software out there which could fully exploit the features of the Epson scanner I have?
    http://support.apple.com/kb/PH11070 OS X Mountain Lion: Troubleshoot a network printer 
    http://support.apple.com/kb/PH11143 OS X Mountain Lion: Reset the printing system
    http://support.apple.com/kb/HT3669 Printer and scanner software available for download
    What to do when you can't print/scan
    Sometimes, installing the GIMP drivers help with printing/scanning issues: http://gimp-print.sourceforge.net/MacOSX.php

  • RT Scan interface mode

    hi guys 
    i want to do a scan mode for a CompactRIO and my friend has not the hardware (cRIO) so i want to know if the Scan Mode requires the hardware or not and if it's possible to make a virtual cRIO plz help help help 

    Hello,
    You can use a certain level of “simulation” capabilities…more like setting up off line devices as explained in Document ID: 3W6EFRLX.
    Unfortunately in Scan mode these features won’t help much if you truly want to simulate the behavior of your program but if you only want to start building the application and preparing the VIs before getting the hardware then it should help you get started.
    Also, you can try to work around the limitation by running your RT VI on the windows Host and the module related logic on FPGA with simulated IO.
    I hope this helps
    Alejandro | Academic Program Engineer | National Instruments

  • Generating executable scan engine mode

    I've developed a software using Labview Scan mode engine. There's a main that will run on the PC and no VI embedded. I need to generate an executable and run it on a PC that doesn't have Labview installed. I want to know if I have to deploy something on the cRIO, and if I have to configure the cRIO on MAX on the PC that it will run, or if not, how do I configure it?

    Hi Thuany,
    Well, the dependencies of the Windows Application will depend on how you programmed your VIs. Can you post your Project so that I can see how you did it and provide you a better answer?
    Thanks
    Felipe Flores
    Engenharia de Aplicações
    National Instruments Brasil

  • WLSE Not showing the RSSI the AP reported Rogue APs in my scanning-only mod

    Hi guys
    I have a WLSE version 2.15.1 which is configured to detect Rogue AP, APs are 1242, when I see the Unknown AP detail the RSSI has a value of 0 for all Rogue AP detected any help or suggestions, I will be very useful.
    Thank you.
    Greetings

    If the RSSI value is zero, then the AP is not active at all. Do you see the same value for all the APs. Does the WLSE provide correct RSSI values for the known APs?

  • How to SCAN uploaded files for VIRUS in APEX

    part 1:
    Goal:
    Do a virus scan of the uploaded file from APEX application prior to storing the file in custom tables.
    The process:
    Followed the document from www.developer.com:
    Implementing an Anti-Virus File Scan in JEE Applications
    By Vlad Kofman
    Go to page: 1 2 3 Next
    This article will discuss one of the ways to implement antivirus file scanning in Java, particular in the JEE applications. Viruses, Trojan Horses, and different malware and spyware are a real problem for current computer environments, and especially for the Windows operating system. If you are designing any application in Java that has a requirement to be able to upload external files, you have a potential security risk. By uploading, I mean any way to get the external file inside of the corporate firewall be it via HTTP protocol or any other means. It is quite common to have this type of requirement in an enterprise application and with Java being one of the most popular web development platforms, it is unfortunate that this type of gaping security risk is quite often overlooked.
    Java's Development Kit (JDK) does not have any means to do the antivirus scan right out of the box. This is primarily because Java is a programming language, and does not have any virus scanning packages. Furthermore, anti-virus software is not Sun's area of expertise or business model. Developing this type of software (or Java package), and more importantly maintaining it, would be a huge task for Sun. Mainly because viruses are constantly evolving and keeping virus definitions up-to-date is a daunting task. Large companies such as McAffee, Symantec, or Zone Labs develop virus detecting and combating products and spend a lot of resources to maintain them.
    Application Environment
    To implement a virus file scan in Java, a third-party package needs to be used. For the purposes of this article, I will use Symantec Scan Engine (SSE) package, which comes with Java APIs. This package is an application that serves as a TCP/IP server and has a programming interface and enables Java applications to incorporate support for content scanning technologies. For this article, I used Symantec Scan Engine 5.1, which is available as a Unix or Windows install.
    If you are using an anti-virus package from the different vendor, you will need to investigate what kind of APIs are available; however, the general approach should be similar. Also, note that my implementation can be used with JEE technology and any modern MVC framework such as Struts or Spring.
    The architecture is as follows: A server machine needs to have SSE running at all times. This can be the same machine that hosts your Application Server, but in an enterprise environment this should be a different machine. The Default Port needs to be open through the firewall to allow communication with the scan engine. All JEE applications that need to do file scanning can talk to the SSE server machine through a default port. Also, multiple applications running on different application servers can re-use the same scanning server. For more information, you should refer to the Symantec Scan Engine (SSE) Installation Guide, available on the Symantec web site.
    When an external file that needs to be scanned is sent to the SSE via its programming interface (Java APIs using the default port), before any other operation on the file is performed, the SSE returns a result code. For instance, a file is uploaded by an external user into the web email type application as an attachment; then, the SSE API is invoked by the application and the return code of pass or fail determines the outcome of the upload and whether that email can actually be sent. If you have an account on Yahoo mail, you probably have seen that Yahoo is using Norton Antivirus to scan all attachments, although no Java.
    Click here for a larger image.
    Figure 1: Screen shot from Yahoo
    For details on the Scan Engine Server Installationm please see the Symantec Scan Engine (SSE) Implementation Guide from Symantec.
    Here are some key things to remember about SSE:
    •     Java 2 SE Runtime (JRE) 5.0 Update 6.0 or later must be installed on the server before the SSE installation is done.
    •     After installation, verify that the Symantec Scan Engine daemon is running. At the Unix command prompt (if it's a Unix install), type the following command:
    ps –ea | grep sym.
    A list of processes similar to the following should appear:
    o     5358 ? 0:00 symscan
    o     5359 ? 0:00 symscan
    If nothing is displayed the SSE process did not start.
    If the SSE process did not start, type the following command to restart SSE:
    /etc/init.d/symscan restart
    •     Keeping the virus definition up to date is the most important task and if new updates are not installed, the whole scan becomes ineffective. Symantec automatically downloads the most current file definitions through LiveUpdate. Please make sure that firewall rules are in place to allow the host server to connect to the Symantec update service.
    Project Setup
    For the purposes of this article, I included a wrapper for the Symantec SSE APIs, av.jar, which has Symantec Java APIs and serves as a client to the SSE server and takes care of all communications with the server. Please refer to the download source section. The av.jar should be included in the Java CLASSPATH to work with the SSE. This jar contains a class called AVClient that takes care of actually sending the files to SSE as byte arrays and returning the result.
    In my project setting, I added three variables to be accessed via the System.getProperty mechanism. For example:
    AV_SERVER_HOST=192.168.1.150
    AV_SERVER_PORT=1344
    AV_SERVER_MODE=SCAN
    The AV_SERVER_HOST is the host name or IP of the machine where Scan Engine is installed.
    The AV_SERVER_PORT is the port where Scan Engine listens for incoming files.
    The AV_SERVER_MODE is the scan mode which can be:
    •     NOSCAN: No scanning will be done (any keyword that does not start with "SCAN" will result in ignoring the call to the Scan Engine and no files will be transferred for scanning).
    •     SCAN: Files or the byte stream will be scanned, but the scan engine will not try to repair infections.
    •     SCANREPAIR: Files will be scanned, the scan engine will try to repair infections, but nothing else will be done.
    •     SCANREPAIRDELETE: Files will be scanned, the scan engine will try to repair infections, and irreparable files will be deleted.
    Note: For the file stream (byte array) scanning, the only meaning full values are "SCAN" and "NOSCAN".
    Using the SSE Scanning Java APIs
    In any class where scan is required, call the scanning API provided in the AVClient object located in the av.jar. The AVClient object will establish connection to the Scan Engine server and has the following APIs:
    Figure 2: The significant APIs for the communication with to the Scan Engine Server.
    If scanning a file on the file system, in SCAN only mode, use the call that accepts filename only.
    If scanning a file on the file system, with SCANREPAIR or SCANREPAIRDELETE, use the call that accepts input and output file names.
    If scanning an in-memory file (byte array), use the call accepting byte array.
    For example:
    import com.av.*;
    Initialize setup parameters:
    static String avMode =
    (System.getProperty("AV_SERVER_MODE") != null)
    ? (String) System.getProperty("AV_SERVER_MODE") : "NOSCAN";
    static boolean scan = avMode.startsWith("SCAN");
    static String avServer =
    (String) System.getProperty("AV_SERVER_HOST");
    static int avPort =
    Integer.parseInt( (String) System.getProperty("AV_SERVER_PORT"));
    Scan check example for an in-memory file byte array:
    public void scanFile(byte[] fileBytes, String fileName)
    throws IOException, Exception {
    if (scan) {
    AVClient avc = new AVClient(avServer, avPort, avMode);
    if (avc.scanfile(fileName, fileBytes) == -1) {
    throw new VirusException("WARNING: A virus was detected in
    your attachment: " + fileName + "<br>Please scan
    your system with the latest antivirus software with
    updated virus definitions and try again.");
    Note that if you are using this code inside of the MVC handler, you can throw a custom VirusException and check for it in the calling method and perform any necessary cleanup. I have included the class in the AV Jar as well.
    For example:
    catch (Exception ex) {
    logger.error(ex);
    if (ex instanceof VirusException) {
    // do something here
    else {
    // there was some other error – handle it
    For more details on the Scan Engine Client API, please see Symantec Scan Engine Software Developers Guide.
    Continuation in part2

    part 4:
    c)     Clienttester.java – This is the gui app set to test if the configuration is working or not. This gui uses the method scanfile(inputfile, outputfile) as you can see the result in the outputpane of the jframe.
    * clienttester.java
    * Created on April 12, 2005, 2:37 PM
    * @author george_maculley
    package com.av;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class clienttester
    implements ActionListener {
    // private String ipaddress = "127.0.0.1";
    private String ipaddress = "199.209.150.58";
    //private String ipaddress = "192.168.0.55";
    static JFrame frame;
    JFileChooser chooser = new JFileChooser();
    TextField pathtofile = new TextField(System.getProperty("user.home"), 30);
    // TextField pathtooutfile= new TextField(System.getProperty("user.home"),30);
    private int port = 1344;
    JButton filechooser = new JButton("Browse to file"); ;
    private String originalfilename;
    private String outputfilename;
    JButton scanbutton = new JButton("Scan");
    TextArea outputarea = new TextArea(20, 40);
    TextField iptext = new TextField("127.0.0.1", 16);
    TextField porttext = new TextField("1344", 5);
    AVClient mine;
    JRadioButton choosescan = new JRadioButton("SCAN");
    // JRadioButton choosedelete= new JRadioButton("SCANREPAIRDELETE");
    /** Creates a new instance of gui */
    public clienttester() {
    public clienttester(java.lang.String ip, java.lang.String infile, java.lang.String outfile, int port) {
    this.ipaddress = ip;
    this.port = port;
    this.originalfilename = infile;
    this.outputfilename = outfile;
    boolean setValues(java.lang.String ip, java.lang.String infile, java.lang.String outfile, int port) {
    this.ipaddress = ip;
    this.port = port;
    this.originalfilename = infile;
    this.outputfilename = outfile;
    return (true);
    public void actionPerformed(java.awt.event.ActionEvent actionEvent) {
    JComponent c = (JComponent) actionEvent.getSource();
    if (c == filechooser) {
    int retval = chooser.showDialog(frame, null);
    if (retval == JFileChooser.APPROVE_OPTION) {
    File theFile = chooser.getSelectedFile();
    if (theFile != null) {
    pathtofile.setText(theFile.getPath());
    // pathtooutfile.setText(theFile.getPath());
    JOptionPane.showMessageDialog(frame, "You chose this file: " + theFile.getPath());
    if (c == scanbutton) {
    //return object that can be passed to AVClient
    String policy;
    int thisport;
    int scanresult;
    String thisip;
    String inputfile;
    String outputfile;
    outputarea.append("Server: " + iptext.getText() + "\r\n");
    if (choosescan.isSelected()) {
    policy = "SCAN";
    else {
    policy = "SCANREPAIRDELETE";
    thisport = new Integer(porttext.getText()).intValue();
    thisip = iptext.getText();
    //mine= new AVClient(iptext.getText(),porttext.getText(),policy);
    mine = new AVClient(iptext.getText(), thisport, policy);
    if (mine.test() == 1) {
    outputarea.append("Sorry. Incorrect parameters specified.\r\n");
    System.exit(1);
    else {
    outputarea.append("Connection to SAVSE initialized.\r\n");
    inputfile = pathtofile.getText();
    // outputfile=pathtooutfile.getText();
    outputfile = "/tmp";
    outputarea.append("Scanning file " + inputfile + " \r\n");
    if (policy == "SCAN") {
    scanresult = mine.scanfile(inputfile);
    else {
    scanresult = mine.scanfile(inputfile, outputfile);
    if (scanresult == 0) {
    outputarea.append("File is clean.\r\n");
    else if (scanresult == -1) {
    outputarea.append("File is infected. \r\n");
    else {
    outputarea.append("Scan error.\r\n");
    void display() {
    Frame f = new Frame("SAVSE JAVA ICAP Client");
    f.setLayout(new GridLayout(1, 2));
    JPanel lpanel = new JPanel(new GridLayout(7, 1));
    JPanel ippanel = new JPanel();
    JPanel portpanel = new JPanel();
    JPanel rpanel = new JPanel();
    JPanel outputpanel = new JPanel();
    JPanel buttonpanel = new JPanel();
    JPanel pathpanel = new JPanel();
    // JPanel outpathpanel= new JPanel();
    JPanel policypanel = new JPanel();
    ButtonGroup policygroup = new ButtonGroup();
    filechooser.addActionListener(this);
    scanbutton.addActionListener(this);
    choosescan.setSelected(true);
    policygroup.add(choosescan);
    // policygroup.add(choosedelete);
    buttonpanel.setBorder(BorderFactory.createTitledBorder("Scan Policy"));
    buttonpanel.add(choosescan);
    // buttonpanel.add(choosedelete);
    pathpanel.setBorder(BorderFactory.createTitledBorder("Path to File"));
    pathpanel.add(pathtofile);
    f.setSize(new Dimension(650, 400));
    f.setBackground(Color.white);
    f.setResizable(true);
    ippanel.setBorder(BorderFactory.createTitledBorder("SAVSE IP Address"));
    ippanel.add(iptext);
    outputpanel.setBorder(BorderFactory.createTitledBorder("OUTPUT"));
    outputpanel.add(outputarea);
    portpanel.setBorder(BorderFactory.createTitledBorder("ICAP Port"));
    portpanel.add(porttext);
    // outpathpanel.setBorder(BorderFactory.createTitledBorder("Path to Repair File"));
    // outpathpanel.add(pathtooutfile);
    lpanel.add(ippanel);
    rpanel.add(outputpanel);
    lpanel.add(portpanel);
    lpanel.add(buttonpanel);
    lpanel.add(pathpanel);
    // lpanel.add(outpathpanel);
    lpanel.add(filechooser);
    lpanel.add(scanbutton);
    f.add(lpanel);
    f.add(rpanel);
    f.setVisible(true);
    public static void main(String[] args) {
    clienttester g = new clienttester();
    g.display();
    d)     my2.java – This is the class file I wrote to test that I am able to send a file and scan it and see the output in the JDEVELOPER. In this case the file is stored on the filesystem of the client machine. JDEVELOPER should be able to see the file.
    NOTE:
    “EICAR.com” is the test file downloaded from Symantec site to test a non malicious virus file. I n order to be able to test it like this, the Antivirus program running on your machine should be disabled, or else Antivirus will kick in and delete the file. In the first place you will not be able to download the test virus file either with anti virus running on the machine you are downloading to.
    package com.av;
    import java.io.*;
    public class my2 {
    static int my_return = 0;
    * @param fileBytes
    * @param fileName
    * @return
    public static int scanfile(String fileName){
    String avMode = "SCAN";
    boolean scan = avMode.startsWith("SCAN");
    String avServer = "xx";--avserver ip address
    int avPort = 1344;
    int the_return = 0;
    if (scan) {
    AVClient avc = new AVClient(avServer,avPort,avMode);
    the_return = avc.scanfile(fileName);
    if (the_return == -1) {
    return (the_return);
    } else
    return (the_return);
    //my_return = the_return;
    return (the_return);
    public static void main(String[] args) throws Exception {
    System.out.println("Hi there in Main");
    byte[] b1 = new byte[4];
    b1[1] = 68;
    my_return = scanfile("c:\\eicar.com");
    System.out.println(my_return);
    e)     Then finally we have my1.JAVA, which takes the filename, and it’s contents in the bytes form and scans the file. The reason for this method is we are not storing the file on the filesystem, it is read into the memory and only if it is clean, it is put into the database or else notify the user.
    package com.av;
    import java.io.*;
    public class my1 {
    static int my_return = 0;
    static int a_length = 0;
    * @param fileBytes
    * @param fileName
    * @return
    public static int scanfile(String fileName,byte[] fileBytes) throws IOException {
    String avMode = "SCAN";
    boolean scan = avMode.startsWith("SCAN");
    String avServer = "xxx";--avserver’s ip address
    int avPort = 1344;
    int the_return = 0;
    if (scan) {
    AVClient avc = new AVClient(avServer,avPort,avMode);
    // File file = new File(fileName) ;
    //byte[] fBytes = getBytesFromFile(file);
    the_return = avc.scanfile(fileName, fileBytes);
    if (the_return == -1) {
    return (the_return);
    } else
    {return (the_return);}
    my_return = the_return;
    return (the_return);
    // Returns the contents of the file in a byte array.
    * @param file
    * @return
    * @throws IOException
    public static byte[] getBytesFromFile(File file) throws IOException {
    InputStream is = new FileInputStream(file);
    // Get the size of the file
    long length = file.length();
    // You cannot create an array using a long type.
    // It needs to be an int type.
    // Before converting to an int type, check
    // to ensure that file is not larger than Integer.MAX_VALUE.
    if (length > Integer.MAX_VALUE) {
    // File is too large
    // Create the byte array to hold the data
    byte[] bytes = new byte[(int)length];
    // Read in the bytes
    int offset = 0;
    int numRead = 0;
    while (offset < bytes.length
    && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
    offset += numRead;
    // Ensure all the bytes have been read in
    if (offset < bytes.length) {
    throw new IOException("Could not completely read file "+file.getName());
    // Close the input stream and return bytes
    is.close();
    return bytes;
    // public static void main(String[] args) throws Exception {
    //System.out.println("Hi there in Main");
    // File file = new File() ;
    // byte[] b1 = getBytesFromFile(file);
    //System.out.println(b1);
    // my_return = scanfile(,b1);
    //System.out.println(my_return); }
    Finally , you have the exceptions file,
    e) package com.av;
    public class VirusException
    extends Exception {
    public VirusException() {
    super();
    public VirusException(String text) {
    super(text);
    Once you have all these classes, you can use JDEVELOPER , to load these classes into the database: This is as follows:
    Right click on the project, which has all these classes.
    NEW -> deployment profiles -> load java and stored procedures.
    When you are created deployment profile, you have to specify,
    Loadjava options.
    -f, -v (check the check boxes)
    Under privileges:
    -s – specify database schema these classes are loaded into
    -s – create sysnonym check box
    -g – grant to public or any specific users per your policy.
    Under Resolver,
    -r and –o (check the check boxes)
    I accepted the default name storedproc1. Then you right click on the storedproc1.deploy, deploy to whichever database connection you created.
    And then, In order to access this java class we need a pl/sql wrapper as follows:
    create or replace package my1 is
    function mycheck (pfilename in varchar2, psize in number)
    return number;
    end my1;
    create or replace package body my1 is
         function mycheck (pfilename in varchar2, psize in number)
    return number is
    language java
         name 'com.av.my1.scanfile(java.lang.String, byte[]) return int';
         end my1;
    And the code is invoked from sql plus as follows:
    Select my1.mycheck(“filename”, “filebytes”) from dual;
    One important catch in the above method is to send the filename and filecontents in bytes form. In order to send the file contents as filebytes, you will need another java class and load into the data base as described above.
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    * This program demonstrates how to read a file into a byte array. This method
    * reads the entire contents of the file into a byte array.
    * @version 1.0
    * @author Jeffrey M. Hunter ([email protected])
    * @author http://www.idevelopment.info
    public class ReadFileIntoByteArray {
    * method to convert a byte to a hex string.
    * @param data the byte to convert
    * @return String the converted byte
    public static String byteToHex(byte data) {
    StringBuffer buf = new StringBuffer();
    buf.append(toHexChar((data >>> 4) & 0x0F));
    buf.append(toHexChar(data & 0x0F));
    return buf.toString();
    * Convenience method to convert an int to a hex char.
    * @param i the int to convert
    * @return char the converted char
    public static char toHexChar(int i) {
    if ((0 <= i) && (i <= 9)) {
    return (char) ('0' + i);
    } else {
    return (char) ('a' + (i - 10));
    * Returns the contents of the file in a byte array
    * @param file File this method should read
    * @return byte[] Returns a byte[] array of the contents of the file
    private static byte[] getBytesFromFile(File file) throws IOException {
    InputStream is = new FileInputStream(file);
    System.out.println("\nDEBUG: FileInputStream is " + file);
    // Get the size of the file
    long length = file.length();
    System.out.println("DEBUG: Length of " + file + " is " + length + "\n");
    * You cannot create an array using a long type. It needs to be an int
    * type. Before converting to an int type, check to ensure that file is
    * not loarger than Integer.MAX_VALUE;
    if (length > Integer.MAX_VALUE) {
    System.out.println("File is too large to process");
    return null;
    // Create the byte array to hold the data
    byte[] bytes = new byte[(int)length];
    // Read in the bytes
    int offset = 0;
    int numRead = 0;
    while ( (offset < bytes.length)
    ( (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) ) {
    offset += numRead;
    // Ensure all the bytes have been read in
    if (offset < bytes.length) {
    throw new IOException("Could not completely read file " + file.getName());
    is.close();
    return bytes;
    * @param filename
    public static byte[] chk_file(String filename) {
    byte[] fileArray = null;
    try {
    fileArray = getBytesFromFile(new File( filename));
    } catch (IOException e) {
    e.printStackTrace();
    if (fileArray != null) {
    for (int i=0; i<fileArray.length; i++) {
    System.out.println(
    "fileArray[" + i + "] = " +
    ((int)fileArray[i] < 9 ? " " : "") +
    ( ((int)fileArray[i] > 9 && (int)fileArray[i] <= 99) ? " " : "") +
    fileArray[i] + " : " +
    " HEX=(0x" + byteToHex(fileArray) + ") : " +
    " charValue=(" + (char)fileArray[i] + ")");
    return fileArray;
    * Sole entry point to the class and application.
    * @param args Array of String arguments.
    public static void main(String[] args) {
    byte[] fileArray = null;
    try {
    fileArray = getBytesFromFile(new File("c:\\eicar.com"));
    } catch (IOException e) {
    e.printStackTrace();
    if (fileArray != null) {
    for (int i=0; i<fileArray.length; i++) {
    System.out.println(
    "fileArray[" + i + "] = " +
    ((int)fileArray[i] < 9 ? " " : "") +
    ( ((int)fileArray[i] > 9 && (int)fileArray[i] <= 99) ? " " : "") +
    fileArray[i] + " : " +
    " HEX=(0x" + byteToHex(fileArray[i]) + ") : " +
    " charValue=(" + (char)fileArray[i] + ")");
    Having main method helps you to run the file in JDEVELOPER or using JAVA.
    DO not forget to load this class into the database.
    And you create the pl/sql wrapper again as follows:
    create or replace FUNCTION TOBY (pfilename in varchar2) RETURN VARCHAR2 iS
    language java name
    'ReadFileIntoByteArray.chk_file(java.lang.String) return byte[]';
    And you call the function from sqlplus as follows:
    Sql>Set serveroutput on size 20000;
    Sql> call dbms_java.set_output(20000);
    Sql> Select toby(“filename”) from dual; --
    this file should be accessible, I mean you will not be able to send a file on your pc, from sql plus as sql/plus is running on your db server.
    You will be able to see the output in sql plus:
    If you are running it from the APEX:
    When we use file browser widget from APEX, the file is stored in APEX_APPLICATION_FILES table. And we retrieve that into a variable and pass this variable to the function as follows:
    DECLARE
    scan_failed EXCEPTION;
    x varchar2(400);
    z number;
    BEGIN
    select filename into x from wwv_flow_files where name = :P1_FILE_NAME;
    select my1.mycheck(x,toby(x)) into z from dual;
    if z = 0 then
    :P1_SUBJECT:= 'PASSED';
    else
    :P1_SUBJECT:= 'FAILED';
    end if;
    :P1_SCAN_RESULT := '** Scanning File **';
    IF UPPER(:P1_SUBJECT) = 'PASSED' THEN
    BEGIN
    :P1_SCAN_FLAG := 'PASSED';
    :P1_SCAN_RESULT := :P1_SCAN_RESULT || ' ** File passed scan **';
    END;
    ELSIF UPPER(:P1_SUBJECT) = 'FAILED' THEN
    BEGIN
    :P1_SCAN_FLAG := 'FAILED';
    :P1_SCAN_RESULT := :P1_SCAN_RESULT || ' ** File failed scan **';
    END;
    ELSE
    BEGIN
    :P1_SCAN_FLAG := 'UNKNOWN';
    :P1_SCAN_RESULT := :P1_SCAN_RESULT || ' ** Scan Is Not Conclussive **';
    END;
    END IF;
    --IF :P1_SCAN_FLAG = 'FAILED'
    -- THEN RAISE scan_failed;
    --END IF;
    EXCEPTION
    WHEN OTHERS THEN
    DELETE from APEX_APPLICATION_FILES WHERE name = :P1_FILE_NAME;
    RAISE_APPLICATION_ERROR (-20000, 'seb OTHERS error encountered - file upload not allowed. Possible virus detected !');
    raise;
    END;
    ACKNOWLEDMENTS:
    1) JOHN SCOTT – who suggested this ICAP API in one of the threads which is my initial starting point in this direction.
    2) VLAD KOFMAN who wrote the article on WWW.DEVELOPER.com
    3) Mr. KIRAN –One of the engineers from Metalink, who helped me at every step of getting this java programs and pl/sql wrappers working. But for him, I would have not completed my project.

  • Error -65581 when using 9146 in hybrid mode

    I have a 9146 cRIO Expansion Chassis and I have FPGA code that uses two modules and I'd like to use the scan engine to read the other two modules (ie hybrid mode).  When I try to read scan engine module data, I get error -65581:
    "CompactRIO:  (Hex 0xFFFEFFD3) The bitfile currently running on the CompactRIO chassis is not configured to support using the RIO Scan Interface in this slot. In the LabVIEW Project window, move the module in the slot from under the FPGA target item to under the chassis item, then recompile the bitfile."
    I recompiled my FPGA code and redeployed everything but it did not make a difference.
    Here is a snapshot of my lvproj file:
    I get the error (-65581) whether I read "Analog In" or "PV Read" IO variables.
    Note that my scan engine looks OK from Distributed System Manager:
    I can confirm the FPGA code is running (am blinking the FPGA LED in my FPGA code and can see it blink).  Also, if I switch from "FPGA" to "Scan Engine" mode, I can get the AI Readings to read without an error.
    I'm using the software below on my RIO:
    Thanks in advance!

    Upgraded to cRIO 2013SP1 and still have the exact same errors.  Once I deploy in FPGA mode, the scan engine modules do not update their IO variables (in Distributed System Manager the variable status says "connecting" instead of displaying the current value.  Do you have any other suggestions?
    Is Hybrid mode supported on cRIO 9146 (which is an Expansion Chassis)?

  • Blue screen of death after Windows 7 update-cant get into safe mode or anything else to fix!Help please?!

    Hi My windows 7 professional did an update 2 days ago as i logged out of windows to go back into os x and since then i get a BSOD when i go into windows which flashes so fast I can't see the error message- -I've tried system repair, restore, image, safe mode, booting off my bootable USB with windows 7 install disk on it- nothing will get past BSOD!!!
    I'm on a macbook air OS X 10 and windows 7 professional - any ideas besides completely wiping hte bootcamp partition using disk utility and reinstalling windows how I can roll back that update please?!
    I wish i didnt have to use windows
    thanks so much for any help I've tried everything I've read online and can think of and no joy!

    Sorry didnt answer other bits!
    I'm on 10.6.8
    I use reFit to boot into Windows so after my last time shutting down from Windows it did an update- since then when I go into windows i get the splash screen a pause then a flash of BSOD and the whole mac restarts (back to reFit menu!)
    I tried doing F8 in the windows and did every option- repair, enable boot logging, scan, safe mode- no joy
    I plugged in bootable USB (i installed from bootable USB originially also but the current USB im using I installed Windows 7 from onto a Dell no probs last week so its fine!) - went through F8 options on that too (booting into the USB windows via reFIt again) - but same issue!
    When I do the system image it just doesnt see the USB drive at all with the backup on it

  • Channel Scan installation starts when TV is turned on

    Toshiba 46UL605U LED TV - When you turn on the TV it always goes into channel scan (installation mode).  Just started within the last month.
    Is there a correction for this. What causes this

    If you can't solve your issue and no one in the community can help, contact support to speak with a tech support agent at (800) 631-3811.
    - Peter

  • SR400 change from GPIB to serial RS232

    Hello! 
    I am new to labview. I was given the task of changing our SR400 gated photon counter from GPIB interface to serial RS232. I am not quite sure to go about this with the code I was given. 
    The sr_400 count VI writes parameters to the SR400 and then reads the data from it using the GPIB. What is the easiest way to change the VI so it uses serial RS232? Should I just removed the GPIB parts in SR400 A gate and Read and replace them with the example for RS232? 
    I would appreciate your help.
    Thank you,
    Maira
    Attachments:
    sr_400 count.vi ‏19 KB
    SR400 Read.vi ‏20 KB
    SR400.LLB ‏132 KB

    Do I need to add a configure serial port function for the write and read part or will one be enough? 
    Do I just directly replace the GPIB functions or do I also need to alter the stacked sequence structures?
    I'm sorry to bother you but I really don't know anything about labview. 
    -Maira

  • FPGA Analog Input with Scan Interface

    Hi all,
    I am rather new to the FPGA Module and have a question concerning analog sampling.
    Before, I used a cRIO in scan mode to perform following tasks:
    A state machine on the host PC performs one task after the other, e.g: output a voltage, run a stepper motor (with the NI 9512), Acquire voltage signals using the scan engine mode, logging data ; next voltage, next stepper position, next measurement, logging to the file,.... and so on.
    Now, I want to perform the same task, however, with a sampling rate that exceeds the performance of the scan engine. So I think I need to jump to FPGA Mode.
    The question is: Can I "mix" the measurement in FPGA while running others tasks of the state machine in scan mode? In more detail, I only "need" the FPGA Mode for the data acquisition, however, for running the stepper motor the Scan mode is perfectly fine and somewhat easier.
    One idea of mine was to create a fpga-vi on the target that acquires a certain amount of voltage samples and sends it to the host. Now, could I run the state machine as I did before, just for the state "voltage measurement" refer to the fpga-vi on the target and get the data?
    Thanks for any hint,
    Jack

    It would be best to not mix the scan engine and the FPGA.  Yes, you can do hybrid mode, but it uses A LOT of your FPGA resourses.  You can still use the state machine in your host, but you will just need to change the commands slightly to use the FPGA interface instead.  Use a DMA FIFO to send your analog data to your host to be logged.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • CC version incompatible with Mavericks?

    Hi, i just upgraded my Mac to Mavericks. I got a message saying 'This version of Adobe CC is incompatible with the system.' Also, im getting a big PS CC error (inserted). AND, ive lost all the fonts i downloaded to my mac from Typekit. How do i resol

  • Unable to create item under a region

    Hi All, I wanted to create a item under one region in a seeded page. When I went to Personalize page, next to the region where I need to create the item, I don't see the "Create Item" button. But for the other regions I see that button. Any ideas wha

  • Classic scenario : Confirmation and invoice in same system ?

    Hello experts, My question is as follows. I am trying to learn various scenarios in SRM as a beginner.i undrstand how the scenarios are present and what they mean . In classic scenario, can i create a goods receipt in ERP(MIGO) and then a invoice in

  • 3rd Party Motion Menus

    Does anybody know of a 3rd party motion menu retailer? The OEM menus are really good, but I would like to see more of what is out there. I have not yet mastered the creation of these menus, soooooo, in the meantime I am willing to pay for some really

  • X61s - Rescue & Restore - There is no Factory Restore option

    I have an X61s with Vista Home Basic, and I want to use ThinkVantage to do a Factory System Restore. I can boot into the Rescue & Restore utility (via the ThinkVantage button or F11), this is  just fine. The problem is :   There is no "Factory Restor