Using, passing enums across subvis (newbie)

Folks,
I am building a set of subvis for a customer who will provide their own interface and use that to call into one of my subvis.
There are many commands (a serial I/O application) to support. What I'm shooting for is an enumeration control for all commands so the customer can just add this to their front panel. As they choose a command this (among other inputs) is passed into my subvi.
The problem: in my subvi I can see each numeric value for a command (I have a driver to mimic the customer) as 0, 1, 2, 3
etc. In the case structure in my subvi I would like to be able to have each case refer to the name of each enum rather than raw numbers. So if the user on thier VI selects GetTemperature I want in my subvi case structure to use that same name,
GetTemperature, rather than 0 and so on.
This is all to simple a thing to do but I don't see the light (newbie gets bit again). I started out passing string to get the
ball rolling but I hate that.
I've been on the forums until my eyes glazed over.
The zip file has my project (of course it's broken because of a mix of integer/strings in a case statement). MiniMain.vi is
what I call the driver and Mila.vi is my subvi that eventually the customer will call into.
Any help would be greatly appreciated.
Dave
Attachments:
MiniMain.zip ‏77 KB

dkl234 wrote:
Thanks Sam. Took a short while but I'm good to go with type def.
But the real problem is: on my driver I will see the enum type names (good). When an enum is choosen I can see it come
over into my subvi as a value (0, 1, 2 etc, still good). I can wire this input to a case structure but the problem is now all I have
is a 0 or 1 or 2 or whatever in the subvi to plug into the case structure. I'm hoping there's a way to programmatically convert
the raw input (0,1,2 and so on) into the enum type names so I can use the enum type names in the case statements.
Is there a way to process the input value (the 0,1,2 etc) in the subvi back into the enum type names?
It sounds like you made a type def, but didn't replace the front panel control on your subVI with that new type def.  Right click the control and select Replace >> Select a Control and browse to where you saved the type def control.  Now when you update the type def, all places that call that type def will also be updated, and you can wire that to a case and it will work with the names.  Please post your code because all I am doing is guessing and having a VI I would know the problem and be able to give a better answer.
Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

Similar Messages

  • How to create a variable, and how to use the same across all the reports?

    Hi,
    Is there any possibility of creating a variable at once and making use of that across in all the Crystal Reports?
    Thanks In advance for your time and solution.

    MohanMRK,
    can you describe how you get the value for this variable?
    is it calculated on one report and then you want to pass it to a 2nd report? if that's the case, what you can do is have the reports linked via an opendocument link and pass the value to the 2nd report as a parameter. the value / parameter is only shared when you press the opendocument hyperlink.
    please see the sdk library [here |http://www.sdn.sap.com/irj/boc/sdklibrary]and scroll down to the opendocument section near the bottom.
    if you are just trying to find a way to share a calculation across reports look into creating a Custom Function which can be added to your repository. please note that this will not pass a calculated value across 2 or more reports, but will just have a shared method of making the calculation.
    as Abhilash mentioned before, there's no way to use an actual Variable across 2 separate reports without them being a main report and subreport(s). in that case you'll want to look into Shared Variables.
    cheers,
    jamie

  • Unable to pass enum to a method

    I am trying to use a enumation to list all the graphics drivers available and when I pass it from my main class to a another objects setGraphicsDriver method (with corresponding argument) I get the error:
    init:
    deps-jar:
    Compiling 2 source files to C:\Documents and Settings\Sean\Desktop\Java Projects\EngineFramework\build\classes
    C:\Documents and Settings\Sean\Desktop\Java Projects\EngineFramework\src\engineframework\Main.java:29: setGraphicsDriver(engineframework.IrrlichtEngine.GRAPHICS_MODE) in engineframework.IrrlichtEngine cannot be applied to (engineframework.Main.GRAPHICS_MODE)
    ie.setGraphicsDriver(myobj);
    1 error
    BUILD FAILED (total time: 0 seconds)
    Here is my main class:
    package engineframework;
    public class Main {
    static enum GRAPHICS_MODE { NULL, SOFTWARE, OPENGL, DX8, DX9 }
    public static void main(String[] args) {
    IrrlichtEngine ie = new IrrlichtEngine();
    GRAPHICS_MODE myobj = GRAPHICS_MODE.OPENGL;
    ie.setGraphicsDriver(myobj);
    ie.initialiseDevice();
    The setGraphicsDriver method that fails:
    public void setGraphicsDriver(GRAPHICS_MODE gm) {
    System.out.println(gm); // debugging info
    // Ensure that the gm GRAPHICS_MODE is actually initialised, if not set it to OPENGL
    if(gm == null) {
    gm = GRAPHICS_MODE.OPENGL;
    switch(gm) {
    case NULL:
    graphicsDriver = E_DRIVER_TYPE.EDT_NULL;
    break;
    case SOFTWARE:
    graphicsDriver = E_DRIVER_TYPE.EDT_SOFTWARE;
    break;
    case OPENGL:
    graphicsDriver = E_DRIVER_TYPE.EDT_OPENGL;
    break;
    case DX8:
    graphicsDriver = E_DRIVER_TYPE.EDT_DIRECT3D8;
    break;
    case DX9:
    graphicsDriver = E_DRIVER_TYPE.EDT_DIRECT3D9;
    break;
    default:
    graphicsDriver = E_DRIVER_TYPE.EDT_SOFTWARE;
    break;
    I am sure its something really silly but its driving me nuts :)

    I think I am close, this is what I now have:
    private static E_DRIVER_TYPE graphicsDriver = null;
    /// GRAPHICS_MODE - List of all available graphics modes
    private static enum GRAPHICS_MODE {
    NULL (E_DRIVER_TYPE.EDT_NULL),
    SOFTWARE (E_DRIVER_TYPE.EDT_SOFTWARE),
    SOFTWARE2 (E_DRIVER_TYPE.EDT_SOFTWARE2),
    OPENGL (E_DRIVER_TYPE.EDT_OPENGL),
    DX8 (E_DRIVER_TYPE.EDT_DIRECTX8),
    DX9 (E_DRIVER_TYPE.EDT_DIRECTX9);
    // Has to return a value...?
    private GRAPHICS_MODE(E_DRIVER_TYPE edt) {
    this.graphicsDriver = edt;
    public E_DRIVER_TYPE getGraphicsDriver() {
    return graphicsDriver();
    Now the code return an error that I need to provide a return value (see program comment). I am not sure why I would need to do that since I looked up some more advaned enum examples and I see it being done the way that you informed me of.
    Also thanks for the assistance, too bad they don't include this tips in books :)

  • RE: passing UserWindow across partitions

    The "partition" reference is a red-herring. What I mean is, the fact
    that you are running across partitions has nothing to do with the error
    you are receiving. Consider the error. It says either one of two
    things is going wrong. Either:
    #1) You are trying to serialize a pointer, or
    #2) You are trying to send a pointer across a partition.
    You are, most manifestly, NOT receiving an error saying "serialized data
    cannot be sent across partitions." In your case, the correct
    interpretation of your situation is error #1). That is, you are trying
    to serialize a pointer (indirectly).
    In short, I have tried to do what you are doing, and the unfortunate
    answer to your problem is: you cannot serialize a window. Since the
    window contains pointers, and pointers cannot be serialized, windows
    cannot be serialized. Sorry...
    From: [email protected]
    To: [email protected]
    Subject: passing UserWindow across partitions
    Date: Tuesday, February 25, 1997 4:43PM
    I'm trying to pass a UserWindow object as a parameter to a method on a
    service object in a separate partition. The idea is to be able to store
    the window object on a server and retrieve it (and display it, etc.)
    later
    from a client. Works great in test mode, but when I run it in
    distributed
    mode, I get the error:
    Attempt to serialize a pointer value or to send a pointer value
    between
    partitions. Values of type 'pointer' can neither be serialized nor
    sent
    from one partition to another.
    I'm guessing this has something to do with the UserWindow.window
    attribute
    having attributes that are pointers to system-specific resources. For
    what
    it's worth, it doesn't work even if I haven't opened the window yet. In
    other words, the following code causes the same error:
    tempWin: someWindowClass = new();
    myServiceObject.takeThisWindow(tempWin);
    Has anyone ever tried this kind of thing before and succeeded?

    Maybe, just maybe, you can use gparted to move the excess space in your new partition which is above your existing partition size after first identifying it as swap.  Then move it to the end of the drive, leaving space for a new partition which is the same size as your existing partition.
    That, maybe, will accept the dd transfer since the partition size is identical.  After all is done, delete the swap.
    I hope I made sense.....

  • Descriptio​n to pass 'enum' to a call library function node

    Hi,
    I'm looking for some description/help regarding how to pass 'enum' to a call library function node.
    The API documentation that I have states something like this:
    enum ibApi_DEVICETYPE_e {
    ibApi_DEVICETYPE_A = (1<<0),
    ibApi_DEVICETYPE_B = (1<<1),
    ibApi_DEVICETYPE_C = (1<<2),
    ibApi_DEVICETYPE_D = (1<<3),
    ibApi_DEVICETYPE_ANY = 0x3f /* used with filter */
    typedef ibApi_UINT32 ibApi_DEVICETYPE;
    The above is one of the input parameters to my call library function node. Hint to some documentation/example VI should be enough.

    An enum requires sequential values, so you wouldn't be able to enter an arbitrary value for each of the enumeration items. You can still use an enum, but you would need a small "accessor" VI that converts the enum to a number. I do this often, as I prefer enums. You can, however, use a ring constant which allows you to enter your own values for each of the labels. With a ring constant you can enter the value based on a format you've selected. By default the format is "Automatic", which means you enter a decimal value. If you right-click on the ring constant and select "Format & Precision" you can change it "Hexadecimal". Then, in the "Edit Items" tab you can enter a hex value in the "Values" column. So, you would have a row that has "ANY" in the "Items" column and "3F" in the "Values" column. This is only if you prefer to see the values in hex.
    Tip: You should make this into a typedef.
    Note: The values for each of the constants are not 0, 1, 3, but rather 1, 2, 4, 8, etc...

  • Creating reference of a subpanel to pass to a subvi

    It does not appear to be possible to creat a reference to a subpanel (to pass to a subvi). Can someone confirm this? Can a subvi in anyway access the subpanel of another vi? This will make my code much more object oriented. Does anyone else feel this is a desired feature? Thanks.
    Zuolan

    In LabVIEW 7.0, on the front panel, popup on the frame of the subpanel control and select Create > Reference. It will create a reference for the subpanel. you can then create control from this and place that on your subVI.
    I haven't actually tried to use one, but I did notice that it does create it.
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • Passing enums as arguments within a jni function

    I am trying to pass enum arguments from a Java/JNI function to a C function. For example,
    public native void java_func(enum pname);
    java_jni_func(JNIEnv * env, jobject panel, enum pname)
    c_func(pname);
    where
    c_func(enum pname);
    But I get the error message "illegal use of this type as an expression"
    Any ideas on how I go about solving my problem.

    Hi DavidBray,
    Your task is very simple, you can pass enum value as argument ( do not pay attention to the message above ). You need only to get the name of an enum value in native method. I wrote you a simple example in MS Windows.
    Here is the code in Java:
    package test;
    public class JEnumToJNI {
         static {
              System.loadLibrary("JNIJEnumToJNI");
         public enum JEnum {
             Ok,
             Cancel
         public static void main(String[] args) {
              PrintEnumValue(JEnum.Ok);
              PrintEnumValue(JEnum.Cancel);
         static native void PrintEnumValue(JEnum val);
    }The native method extracts the name of enum value and prints it. This is code of JNI module:
    #define WIN32_LEAN_AND_MEAN
    #include <windows.h>
    #include <stdio.h>
    #include <string>
    #include "test_JEnumToJNI.h"
    using namespace std;
    // Converts jstring to string object
    string jstring2string(JNIEnv *env, jstring js)
        string result;
        long len = env->GetStringUTFLength(js);
        char* p = (char*)malloc(len + 1);
        memset(p, 0, len + 1);
        if(len > 0)
            env->GetStringUTFRegion(js, 0, len, p);
        result = p;
        free(p);
        return result;
    BOOL APIENTRY DllMain( HANDLE hModule,
                           DWORD  ul_reason_for_call,
                           LPVOID lpReserved
        return TRUE;
    JNIEXPORT void JNICALL Java_test_JEnumToJNI_PrintEnumValue(JNIEnv* env, jclass, jobject enumVal)
        // Get enum class
        jclass jclassEnum = env->GetObjectClass(enumVal);
        if(jclassEnum != 0)
             //Get toString() method
            jmethodID toString_ID = env->GetMethodID(jclassEnum, "toString", "()Ljava/lang/String;");
            //Get enumVal name
            jstring jstrEnum = (jstring)env->CallObjectMethod(enumVal, toString_ID);
            fprintf(stdout, "enum value: %s\n", jstring2string(env, jstrEnum).c_str());
            // Delete local references created
            env->DeleteLocalRef(jstrEnum);
            env->DeleteLocalRef(jclassEnum);
        else
            // If jclassEnum == 0 clear Java Exception
            env->ExceptionClear();
    }The header generated with javah.exe
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class test_JEnumToJNI */
    #ifndef _Included_test_JEnumToJNI
    #define _Included_test_JEnumToJNI
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     test_JEnumToJNI
    * Method:    PrintEnumValue
    * Signature: (Ltest/JEnumToJNI/JEnum;)V
    JNIEXPORT void JNICALL Java_test_JEnumToJNI_PrintEnumValue
      (JNIEnv *, jclass, jobject);
    #ifdef __cplusplus
    #endif
    #endifYour task is very simple and you need not to substitute enum values with numbers.

  • How to use in enums in multiple places?

    How does one use an enum set in multiple places in a vi?
    I have resorted to just copying an existing one when I need the same set of enum values in a different spot, but doing it this way will be a big hassle if/when I want to add items to the enum, because I would have to locate every copy of the enum and update them idividually.
    Is it possible?

    It's not so much the "custom control" part as it is the typedef part. A typedef enforces the datatype for all its instances, including constants, so changing it will propogate through your entire code. To create it the easiest way is to create a front panel enum control and then right click it and select Advanced>>Customize. You can then change it into a typedef and save it under any name you want.
    From this point on, you can simply use that typedef in your code.
    To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
    Try to take over the world!

  • How to use a connection across multiple request

    What is the idea of using a connection across multiple requests.

    Please give more details. What connections and what requests
    And are you posting on the right forum? (This sounds more like a Networking/servlet question)

  • How to convert word doc into pdf - which product of adobe i need to use- what upgrades - am a newbie

    How to convert word doc into pdf - which product of adobe i need to use- what upgrades - am a newbie -  simple answers please - Thanks in advance.

    @Pipeline2007 - which version of Microsoft Office have you got? Older versions of Acrobat aren't compatible with the latest versions of Office, see this link for info:
    http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html

  • What's the best way to use an enum to validate statuses

    I am trying to write and use an enum to represent a status code and validate status code values. Ultimately the input data from another system and the database will be 1 or 2 i.e.the indexes and the java code will use the LIVE and CANCELLED when referring to the status. The code I have written
    public class TestEntityStatus {
         private static EntityStatusImpl es;
         public static void main(final String args[]){
                    es =  new EntityStatusImpl();  
                    es.setStatusCode("1"); // valid test
                    es.setStatusCode("3"); // invalid test
    }The EntityStatusImpl class:
    public class EntityStatusImpl {
        private String statusCode;
        public EntityStatusImpl() {
        public final String getStatusCode() {
            return statusCode;
        public final void setStatusCode(final String statusCode) {
             String allStsIndexesAsRegExpr = "[";                                                                                 //
                EntityStatus allStatuses [] = EntityStatus.values();                                                     // would like to 
                for(EntityStatus e : allStatuses)                                                                                // put this code
                    allStsIndexesAsRegExpr = allStsIndexesAsRegExpr + e.getStatusCode();   // in the enum
                allStsIndexesAsRegExpr = allStsIndexesAsRegExpr + "]";                                        // EntityStatus
                System.out.println(" allStsIndexesAsRegExpr = " + allStsIndexesAsRegExpr);           //
                 if (statusCode.matches(allStsIndexesAsRegExpr)) {
                     this.statusCode = statusCode;          
                 else {
                      throw new IllegalArgumentException("Entity status " + statusCode + " is invalid");     
    }The EntityStatus enum has a method "getAllIndexesAsRegex" which I would like to call. However, my understanding of enums is preventing me from doing so.
    If I declared an EntityStatus, I expected that I would be able to get all of the indexes back as follows in
    EntityStatus x;
    x.getAllIndexesAsRegex();
    Instead I have to copied the code from the enum into the setStatusCode method above, where it works but does not seem to be in the right place.
    public enum EntityStatus {
                     LIVE(1), CANCELLED(2);
                     private int index;
                 private EntityStatus(int index) {
                     this.index = index;
                  public int getStatusCode(){
                           return index; 
                  public String getAllIndexesAsRegex(){
                       String output = "[";
                       PromiseStatus allStatuses [] = PromiseStatus.values();
                       for(PromiseStatus p : allStatuses)
                            output = output + p.getStatusCode();
                       output = output + "]";
                       return output;
         }The java tutorial doesn't seem to throw much light on this type of application of enums for me, neither does Herbert Schilt's excellent book on Java 5.
    Can anyone spot any flaws in my logic or suggest better ways of achieving this?

    If you want to ensure type safety and retrict the user to a range of values it seems to me you are over complicating
    the implementation. Simply change your Impl class accessor and mutator methods to accept and return the enum
    type respectively. For example:
    private EntityStatus entityStatus;
    public EntityStatus getEntityStatus()
       return entityStatus;
    public void setEntityStatus(EntityStatus entityStatus)
      if (entityStatus == null)
        throw new IllegalArgumentException("Invalid entity status!");
      this.entityStatus = entityStatus;
    }The one downside is that you are retrieving the actual underlying enum values from external source systems which you need to map back to your
    enum types. Unfortunately the Enum class does not have a method that will return what you need (the valueOf method returns the enum type
    based on the enum name). However you can provide a method in your enum class that will map the external source values to the enum. Below is
    one such implemetation.
    import java.util.HashMap;
    import java.util.Map;
    public enum EntityStatus
      LIVE("1"),
      CANCELLED("2");
      private String statusCode;
      private static Map<String,EntityStatus> enumMap = new HashMap<String,EntityStatus>(EntityStatus.values().length);
      static
        enumMap.put(LIVE.getStatusCode(),LIVE);
        enumMap.put(CANCELLED.getStatusCode(),CANCELLED);
      private EntityStatus(String statusCode)
        this.statusCode = statusCode;
      public String getStatusCode()
        return statusCode;
      public static synchronized EntityStatus deriveObject(String statusCode)
        return enumMap.get(statusCode);
    }Below is a usage example:
      public static void main(String args[])
        EntityStatus status1 = EntityStatus.deriveObject("1");
        EntityStatus status2 = EntityStatus.deriveObject("2");
        EntityStatus status3 = EntityStatus.deriveObject("3");
        System.out.println(status1);
        System.out.println(status2);
        System.out.println(status3);
      }

  • When and how does the message context get removed from the message when we use pass thru send port

    Friends,
    i have a doubt regarding message context.
    Assume i have used XMLRecieve pipeline in the receive side to receive the message so that the message context is created. I.e properties are promoted/written.
    now if we use pass thru transmit pipe line at send side, how and when does the message context get removed from the message?? Since pass thru does not have any stages/components, how does the message context removed and sent out a pure message to destination???
     i mean what exactly happens here to remove the context??
    Ravindar

    Thanks for the reply.
    "The Context is created by the Adapter, regardless of any Pipeline or Pipeline Component.  It has nothing to do with PassThrough vs. XmlReceive, although XmlReceive will write Promoted Properties to the existing Context,
    as can any other Component."
    yeah yeah, adapter does create some properties in context. You are right, i am aware of it. I just missed to explain it clearly. what i meant is addition of context properties will not happen if pass thru used. Thanks its clear.
    "No.  The Context already exists on the Message when it comes from the MessageBox and
    is equally available to any Component in any Stage.  The Context that hits the Pipeline is whatever was last Persisted, either by a Receive Port or Orchestration.  It is not created by the XmlAssembler (XmlTransmit)"
    You are right , the context already exists on the message while it leaves the receive port, and once it persists
    to message box the context and message context gets stored in messages in relative tables.
    Now as you said the components get the message from the last persistence, assume i have a send port(with passthru)
    subscriber and a orchestration subsrciber for this message.
    Orchestration gets the message with context right!!
    if the send sendport(with passthru) also gets message along with context, then where is this context removed/demoted
    while sending it out?.  i guess as per SAAkhlaq said,
    here sendport(with passthru) should get a pure message without context as passthru used. 
    or is it that ultimately send adapter removes the context completely?
    or is it something like biztalk run time load the context from database into cache and both orchestration and send port gets pure message, and if needed they use context from cache???
    sorry i may be troubling you, but i am confused. i hope i am not creating any nuisance with this
    post.
    Ravindar

  • I'm trying synchronize the use of iMessage across all of my devices.

    I'm trying to syncronize the use of iMessage across all of my devices. I setup iMessage on two desktop computers and my iPhone using the same AppleID. When I try to use that AppleID on my iPad I'm told that "The user name or password for (AppleID) was incorrect. Try again." This is the same user name and password that I used on the other three devices and it worked fine. I need some help. Thank you.

    Bobreba wrote:
    I am using Quicken Essentials 1.7.4 on a [Mac Pro, 2.8 Ghz Quad Core Intel Xeon with 16 Gb of memory], running 10.7.5.  I am in the process of upgrading everything to work on Yosemite and Quicken seems to be the most difficult problem to overcome.
    Thanks for your response and feedback.
    I would recommend you continue with Quicken Essentials.  As noted by others, it performs well on Yosemite.
    My personal experience is Quicken 2007 for Mac also on 10.7.5 (with many reports of it both updated and successfully running on Yosemite) and I personally would not touch Quicken Essentials with a 10 foot pole -- BUT, if it ain't broke for you, don't fix it!

  • 3230 Mobile Access Router not Passing Traffic across WMICs

    I'm unable to pass traffic across the WMICs. I've assigned the BVIs ip addresses in the same subnet and I'm seeing the devices associated. I attached the configurations.
    Thanks,

    A ruggedized router in a flexible and compact design, ideally suited to create mobile networks in and around vehicles.
    Here is the URL for the furthere information for grounding in the vehicales and description :
    http://www.cisco.com/en/US/prod/collateral/routers/ps272/prod_presentation0900aecd802948c0.pdf
    http://www.cisco.com/en/US/products/hw/routers/ps272/ps4375/index.html

  • Can I use a variable across events?

    Hi there,
    SDK newbe! I'm successfully parsing an GroupWise WebAccess event log.
    At the beginning of each days log is a line with the server name and IP
    address. Subsequent events only have the date/time and event message.
    How can I capture the name and IP of the sever and then use it for
    SourceIP and SourceHostName for all the other subsequent events?
    if (this.s_RXBufferString.search(/^.*?IP Address: (\w+) \((.+)\)/) !=
    -1) {
    /^.*?IP Address: (\w+) \((.+)\)/.exec(this.s_RXBufferString);
    var InitSrvr = RegExp.$1;
    var InitSrvrIP = RegExp.$2;
    this.evt = "Test_IP_Variable";
    this.bm = this.s_RXBufferString;
    this.sip = InitSrvrIP; //This does work
    this.shn = InitSrvr; //This does work
    this.sun = ("KirkWasHere " + InitSrvr);
    instance.SEND_EVENT = true;
    return true;
    // give the following a try. $1-$3 are mm-dd-yy, $4-$6 are hh-mm-ss,
    else if (this.s_RXBufferString.search(/(\d{2})-(\d{2})-(\d{2})
    (\d{2})\d{2})\d{2}) (Login failed): (\S+)/) != -1) {
    /(\d{2})-(\d{2})-(\d{2}) (\d{2})\d{2})\d{2}) (Login failed):
    (\S+)/.exec(this.s_RXBufferString);
    this.evt = RegExp.$7;
    this.sun = RegExp.$8;
    this.sip = InitSrvrIP; //This does not work?
    this.shn = InitSrvr; //This does not work?
    this.bm = this.s_RXBufferString;
    this.sev = "3";
    instance.SEND_EVENT = true;
    return true;
    kmaule
    kmaule's Profile: https://forums.netiq.com/member.php?userid=306
    View this thread: https://forums.netiq.com/showthread.php?t=46902

    kmaule,
    First, ARGH! Why can't systems create audit data? Or if just logging
    data, why can't they do something sensible like have a date in there like
    everything else? *sigh*
    Okay, I feel better now. I have not tried either of the following ideas,
    but I want to share them so you can figure them out and hopefully post
    back their feasibility. I'm hoping to have time to test this next week,
    but who knows with how things have been lately... busy busy. Here are the
    two ideas:
    1. Collector development has the idea of a 'Session' object which is made
    to span across two events. This is useful when you need to link two
    original events to create one Sentinel events, such as with OES and
    filesystem auditing; in that case the OES system sends three lines per
    filesystem event and Sentinel must group them to create one Sentinel
    event. Similarly, eDirectory object-create events are actually two events
    (object create without object class, and add-value with the object class)
    that become one in Sentinel (eDir auditing is just THAT lost-level...
    crazy) and also LDAP events from eDir consist of the LDAP Request event
    and the LDAP Response event. Session objects make this possible, but they
    are meant to exist for a short period of time (I think usually one second
    or so, though they have a customizable timeout as I recall) and are meant
    to be created and then used when other conditions are satisfied. My hope
    is hat you can abuse this functionality to store a variable between events
    and then nuke the old session object when a new date comes through. More
    on sessions:
    http://www.novell.com/developer/plug..._sessions.html As I
    read more about this I think it's not going to be as possible as I
    thought. Hmmmm
    2. Set a variable on the collector object somehow, and I mean in-memory,
    not in the hard-coded plugin or something. I need to get the debugger
    going to see how this could work, but the problem with your local
    variables is that they're local variables, so they do not persist when the
    current variable scope (the current function/method) returns to whatever
    called it, so the next time something calls it then they are brand new
    again. The logic needs to set these variables somewhere that will persist
    (Session or collector object instance level) so that it can be retrieved
    from there for each subsequent event.
    Other dirty things I would not recommend, but which may work. I believe
    you can get at dynamic list data in collectors. You could potentially
    store the date there when it comes in and then retrieve it on subsequent
    events.
    Other dirty things... use the current date for everything. Pulling this
    up in code should be trivial, but it implies that events come in on the
    current date. That's probably a safe assumption 99.99% of the time, but
    some events may come in wrong at the start of a new day, though you could
    add logic to help with that too.
    Ideally GW needs better logs, and more than that it needs a true auditing
    interface of some kind.
    Good luck.
    On 02/21/2013 08:54 AM, kmaule wrote:
    >
    > Hi there,
    >
    > SDK newbe! I'm successfully parsing an GroupWise WebAccess event log.
    > At the beginning of each days log is a line with the server name and IP
    > address. Subsequent events only have the date/time and event message.
    > How can I capture the name and IP of the sever and then use it for
    > SourceIP and SourceHostName for all the other subsequent events?
    >
    > if (this.s_RXBufferString.search(/^.*?IP Address: (\w+) \((.+)\)/) !=
    > -1) {
    > /^.*?IP Address: (\w+) \((.+)\)/.exec(this.s_RXBufferString);
    > var InitSrvr = RegExp.$1;
    > var InitSrvrIP = RegExp.$2;
    > this.evt = "Test_IP_Variable";
    > this.bm = this.s_RXBufferString;
    > this.sip = InitSrvrIP; //This does work
    > this.shn = InitSrvr; //This does work
    > this.sun = ("KirkWasHere " + InitSrvr);
    > instance.SEND_EVENT = true;
    > return true;
    > }
    >
    > // give the following a try. $1-$3 are mm-dd-yy, $4-$6 are hh-mm-ss,
    > else if (this.s_RXBufferString.search(/(\d{2})-(\d{2})-(\d{2})
    > (\d{2})\d{2})\d{2}) (Login failed): (\S+)/) != -1) {
    > /(\d{2})-(\d{2})-(\d{2}) (\d{2})\d{2})\d{2}) (Login failed):
    > (\S+)/.exec(this.s_RXBufferString);
    > this.evt = RegExp.$7;
    > this.sun = RegExp.$8;
    > this.sip = InitSrvrIP; //This does not work?
    > this.shn = InitSrvr; //This does not work?
    > this.bm = this.s_RXBufferString;
    > this.sev = "3";
    > instance.SEND_EVENT = true;
    > return true;
    >
    >

Maybe you are looking for

  • Beginner CORBA idl struct said to be abstract class

    How do I instantiate a class declared in my .idl file for use by the methods implementing the interface? I want to return an array of Record objects in my CORBA implentation, and my .idl file has:  struct Record     long recordNumber;     string firs

  • In process rejection of raw materials

    Dear Experts,       My client is having 01 and 04 type inspection active, now he want that when doing production while issuing goods to production if he found some raw materials of poor quality then they should be return to vendor, how i can map this

  • The use of Cond type tab in Pricing procedure determination

    Hi Guys, In T-code:OVKK we  are doing the pricing procedure determination. But ther is one tab called as :CType(Cond Type) there in that screen after our pricing procedure. Could you please some one tell me what is the use of this cond type and where

  • CSS 11052 & 11501

    hi Is it possible to do load balancing and failover with css11052 and css11501 Thanks for yor response

  • Moving apps on itunes

    my apps are shadded and i cant move or arrange my apps on itunes any idears