Jump to content

Eugen Graf

Members
  • Posts

    432
  • Joined

  • Last visited

Posts posted by Eugen Graf

  1. QUOTE(Thang Nguyen @ May 8 2007, 04:15 PM)

    Hi,

    You can take a look at the "Create by Ref" from the GOOP Developer of Sciware. It allows you create specific object from the generic object. I don't have much experience with other GOOP.

    Why I should use another GOOP Tools? Its not possible with LVOOP (LV8.2) ?

    Eugen

  2. QUOTE(Thang Nguyen @ May 8 2007, 12:10 AM)

    Hi,

    You can start to write a class with variable is the path to the file, and with methods such as: add one item, read one item, verify item, delete one item, ...(Those method use basic VI working with configuration file). In those methods you will use the variable path and the parameter is the information of the item.

    Then after that, you can add more features, more specific to these methods thourgh inheritance.

    Thanks Thang Nquyen, I will do it.

    But why I have to begin with FILE PATH as my first class? I can consider my file as an object, but I thought my objects shoulb be my items, not the DB-file. I would create my General-Item-Class and add the file path as property. It's not right?

    Eugen

    P.S. yes, it's right, either way, earlier or later the file path will be one of properties in my general class.

    Other question: how can I create an object from two classes?

    I think, if the user clicks on the "add new item" and then select the type, I will create a new object of type "special class", which is inherited from my generall class and have additional item-type-special props and methods.

    Eugen

  3. QUOTE(Michael_Aivaliotis @ May 8 2007, 04:16 AM)

    Are you referring to a specific vi server method or the general concept of publish/subscribe?

    I would think that if you create a queue and then dequeue this constitutes a publish subscribe one to one. If you need multiple subscribers then you would have to somehow create an array of queues. When someone subscribes, you add a new queue to the array. The publisher in this case would have to put the message onto all the queues.

    Thanks Michael, I need generally informations to publish subscriber in relation to Labview, how to and examples. Are there any? Or should I make me one myself?

    Queues in array should be variant? I think, yes. A little example code, which only explains how to implement a easy one?

    Eugen

  4. Hello,

    I want to make my first OOP-Project(for me, private, not for sell, only to get any experiance in LVOOP). The program must handle a table file with some general informations about media files(films, songs, photos a.s.o). By clicking on a row in the table - more file special informations should appear. Items should can be sorted by any column in the table and a search function should be implemented. Don't think it's my homework! I have this project just completely ready to run and it works(but is not OOP-based).

    My plan is following:

    create a class that have general properties like item-number(ID), name of item, name of file, kind, date, source, place on HD, place in the room, size, number of CDs or DVDs and general methods like set/get general properties.

    Than I want to inherit this class to more specifical classes, e.g.

    for films I add more properties: regisseur, headliners. Specifical methods: set/get spec. props for films

    for songs: props - songer, album. Methods: set/get props for songs

    and so an.

    It's right way to make that? Where should I begin with LVOOP?

    Thanks, Eugen

  5. Ups, sorry, see here http://forums.lavag.org/index.php?s=&s...ost&p=29306

    Probably I am to nervous if I see my project at work an if my boss say me to make it faster. If a am home I see, where the problem is. I can imagine how to make it right, but if a am on work...

    Eugen

    So I have only to memorize :throwpc: , that a queue can not simply be a data buffer, but it can have a important functionality. It can "say" to a task, what to do with data in the same message. It's very significant for me.

    Eugen

  6. QUOTE(Tomi Maila @ May 3 2007, 09:02 PM)

    The memory is sometimes limited. If it wasn't you wouldn't need a lossy queue. I don't understand what's the benefir of warning the user? What can the user do about anything?

    He can buy a better PC (faster and with more memory), he can turn off other tasks and processes, he can sample data slower, he can call you and you can recommend it to him.

    I think it's wrong to drop anything and nobody knows about is, and if he makes posprocessing of this data, he see other results as expected.

    Eugen

  7. QUOTE(Tomi Maila @ May 3 2007, 07:25 PM)

    Lossy queues are usually needed when the queue writing process needs to be deterministic to avoid source buffer overflow, and the queue consuming process is often undeterministic. You need lossy queue because the undeterministic consumer is sometimes slow consuming the queue and the queue get's full. The problem with locking is that it makes the producer thread undeterministic. You can no more rely on the fact that you always succeed to enqueue your stuff. This may result in source buffer overflow. A common use case is that you try to enqueue the elements in your DAQ hardware buffer, whichi is of limited size. You need to clean-up the buffer deterministically to avoid overflow. If you lock your queue, you cannot guarantee this anymore.

    Why not to make the queue bigger and dequeue it as usual? And if the queue will be nearly full, then flush it and signal a warning to the user.

    Eugen

  8. QUOTE(i2dx @ Apr 25 2007, 08:15 AM)

    Eugen,

    I use the RS232 VIs for serial communications, and I never had any serious truble. I've never heard of this issue, therefore, I can't provide an answer. The best ressource for such issues is the NI website and if you can't find any entrys for that error# there, I'd suggest to contact an AE @ NI support.

    Ok, I deleted all Event VI from my BD and replaces them by normally Wait VI -> error is avay now, but my program is no more event controlled.

    It's a pity.

    Eugen

  9. Hello, if I use VISA event "Serial Character", I get follwing error Message:

    Error -1073807315 occurred at VISA Wait on Event in SK_Task_Read_Parse_A.vi->SK_Interface_A.vi->SK_Main.vi

    Possible reason(s):

    VISA: (Hex 0xBFFF002D) The event queue for the specified type has overflowed. This is usually due to previous events not having been closed.

    Can anybody say me, how to get it away and why it appears?

    I tryed to discard occurences before waiting on event, I tryed to enable/disable event before/after I wait on it. But it comes again and again.

    Eugen

  10. QUOTE(Michael_Aivaliotis @ Apr 18 2007, 06:40 PM)

    Are your devices, serial? I think only serial devices really need to be closed to release the port for others to use. GPIB devices don't have to be opened or closed. At least not anymore. Other than Visa Open or Visa Close, I'm not sure what kind of instrument command you want to send.

    Regardless. If this is still the case, you can do this with queues as well. Keep in mind that you will need different queues for different types of tasks. The example shown assumes that you are working with the instrument task queue. Also, I haven't used any subvi's to keep the example simple but I would suggest encapsulating the enqueue functionality into subvi's.

    http://forums.lavag.org/index.php?act=attach&type=post&id=5546 (LabVIEW 8.0)

    There are many solutions to your problem. User events can be used as well. However, I would even argue that you don't need parallel tasks anyway. Why can't you just do everything in the main state machine? I'm not sure of the benefit in your case. Perhaps data saving would be better off in parallel if you have lot's of data. What is the speed of the overall system?

    Like I mentioned, there are others who will suggest solutions different to mine. I have also used user events and various GOOP frameworks, however this is all I have for now.

    Hello Michael, your solution is realy good, I can understand it and thank you for.

    Can you say me how to make it for reading task? Not so easy, I think.

    It can be anything, but not locals, globals or references. And no timeouts in event sructure.

    Thank you.

    Eugen

  11. Thanks Michael,

    I will show your VI more detailed and answer later.

    To your questions: there may be up to 8 devices (my biggest project) with different interfaces. The most are serial, but some of them TCP/IP and CAN, no GPIB.

    Here an example of my older project (for two devices), you will see that I can't place all VIs on one display screen. And if there are much more devices, then the BD would be bigger. I can in fact hide more SubVIs into one, but I don't think my program will be well arranged.

    Please no critic, I know the BD on the snippet have more programical errors, but think on I was a LV-beginner at those time.

    Eugen

  12. Hello,

    I love the synchronisation palette of LV and multitasking functionality of them. My actually application architecture for communicating with devices over any interface is following:

    My application contains e.g. 5 tasks:

    1. main task - is a state machine with ca. 10 steps.

    2. read & parse task

    3. log data to hard drive task

    4. show data to user task

    5. write data (command) to devise task

    steps in the main task are following:

    1. settings - reads and writes settings cluster to a XML-File. If no XML-File exists, a settings window pops up, user have to make settings and they will be written to a new XML-File.

    2. open interfaces - inits and opens interfaces to devices with settings from XML-File

    3. start tasks - starts another (see above) tasks dynamically.

    4. wait on commands - contains a event structure, which queries user events from FP

    5. reinit program - if settings are changed by user, all tasks will be reset with Set Value Property, device interfaces will be closed and reinit

    then if user want to exit program

    6. stop tasks - all tasks will be stopped by closing queue or notifier refnums

    7. terminate tasks - if any task runs after closing refnums (normally not used) then this task will be aborted

    8. close interfaces

    9. exit LV

    Also, to communicate between tasks I use (easy example with only one devise):

    1. One queue - read&parse task put messages into this queue and log task gets this messages and logs them to hard drive

    2. One notifier - read&parse task put messages to notifier and show task gets them and shows to user

    3. One notifier - user puts any commands to this notifier and "send to devise" task gets them and sends to devise

    Its okey? Good or bad?

    Now I want to replace my communication mechanism because of following problem:

    http://forums.lavag.org/index.php?s=&s...ost&p=28344

    What do you think about it?

    best regards, Eugen

  13. Thank you very much for detailed answer.

    QUOTE(Michael_Aivaliotis @ Apr 18 2007, 09:15 AM)

    I know that my code doesnt make sany sense, my code is only to probe, what User Events can.

    QUOTE(Michael_Aivaliotis @ Apr 18 2007, 09:15 AM)

    I want both - to solve my problem & to decide if the mechanism with user events can replace the machanism with queues.

    Your solution with cluster queue is interesting, but have a disadvantage. My question is: what happens if I only want to change the interface (if user changes program settings) without to send any message to visa?

    Therefore I want to separate message from settings with user events. If settings changes by user I will send settings user event, if a message must be send to visa, I will use the message user event.

    Eugen

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.