Design problem: RS232 communication

Hi,
I have a design problem for communication with a device via RS232. Since I'm normally a C++ programmer I might just look at the problem from a wrong angle and hope for some hints how to do it in LabVIEW.
The scenario:
A device is communicating with the PC via RS232. The device permanently sends data packets. At the same time, commands can be sent to the device and it returns replies. Data packets and reply packets are arbitrarily mixed, i.e. after sending a command there could be a couple of date packets before the reply comes back but the packets can be distinguished by an identifier.
At least one, ideally several VIs should communicate with the device. Commands should be sent by pressing buttons and the incoming data should be parsed (the packets contain mutliple data streams) and shown on graphs or saved to files.
My initial idea:
Coming from C++ I wanted to build a class for the communication that permanently reads the incoming data and splits it to reply and data packets. This class would then have a function to send out a command and would return the reply or a timeout and it would be possible to register and unregister listeners (I wanted to use queues for this) for the various data streams.
The problems I ran into:
There were a couple but the two most pressing problems were: how could I communicate with the constantly running sample VI (e.g. to stop sampling) and how could I propagate changes to the class to it (e.g. new listeners). Since it is not returning I don't see a good way to implement it as in instance funcion (i.e. pass it the object). I could probably not let the sample function run continously but call it periodically from outside. However I planned to implement the class as a singleton, so it could be used parallely from different VIs.
Is there a best practice for a case like this?
I'm glad about any hints or ideas.
Thanks,
Tobias

tfritz wrote:
Hi,
thanks. Since almost the same thing was suggested to me in a German forum I guess this is really common practice (using one VI with different methods controlled by a queue). It still seems a little "unnatural" for me but my biggest concern (bad interface description) was shattered by the suggestion in the link you sent me to wrap these functions with wrapper VIs, thus caller VIs won't have to deal with the call-by-queue-mechanism. This might also be easier to port to a different implementation later. However I still see the danger that the continously running VI could easily become bloated. 
It also requires me to change the way I have looked at VIs until now. In our course they told us that VIs are basically functions. Using this design patterns, the VI becomes more of a module, really (Like a C module implemented in a C-Source file). But I will try it. It sounds as if it could work.
I will still look into the OOP solutions a little more, though. Do I understand you correctly that you wouldn't recommend using LVOOP because it's still buggy? What about dqGOOP for example? This sounds like it could do what I need (however it doesn't seem to implement things like polymorphism, late binding and inheritance so I don't quite see what's so OOP about it. It seems more like programming with structures in C.)
I don't know if LVOOP is buggy or not.  I think early on it was buggy and things have improved in recent versions. I have read that it doesn't have all the features that you would have in OOP like C.  I wouldn't recommend it only because I'm not familiar with it at all.  I can't recommend something that I'm not comfortable with.  If you go that route, plan on spending time in these forums and in LAVA to reading up on what others have done.  I haven't hard of dqGOOP.
But back to your suggestion. I still have a couple of questions:
- How do you return values from the module? Would you use a queue for that as well?
- Where would the parameter queue be held (created and passed to the VI)
 I would store all of these in a functional global variable.  This is the VI that stores data in shift registers.  Ben's action engine nugget is an advancement on that.  This allows for both the calling VI and the parallel running subVI to get and set the data as needed.  It runs quickly so neither process should be forced to wait while the other  VI is doing its thing.
- My VI has to be constantly sampling and this shouldn't be interrupted too long by other functions as adding a listener. However both functionalities have to access the same kind of data. Is there an easy way to parallelize this? Would the sampling be a case in the case diagram that's always used if no command was sent to the VI or would it somehow run parallely?   Yes.  There are a couple of ways of doing this.  One would be for the dequeue to have a timeout function.  In the event the dequeue times out, you run the code that is doing the acquisition.  I think a better method is that the code that does the acquisition enqueues its own command again to the end of the queue.  Let's say that is command A.  So when case A finishes, it enqueues A, which seeds itself to run again.  So if nothing else comes into the queue, it just executes A , A, A, A.  But let's say another section of code needs to do something such as command B.  It will slip B into the queue while A is executing.  So you would A, B, then A again, because A would get slipped back into the queue when the first A finishes, but B has already been put in while the first A was running.
- Would it be possible to make the VI reentrant and in this way use it simultaneously on different COM ports (using different parameter queues as well)? I'm not sure if I will need this but it would be neat if it could work.
I think you could do this.  It may be a case where the VI is saved as a template  (.vit) and you initiate it multiple times.  I haven't needed to do this before, so I'm afraid I can't provide any details or useful tips. 
Well, I will fool around some more. Thanks so much for your help. This is kind of exciting since the concepts are quite new for me. Btw, is there something like an academic theory (computer science) for LabVIEW? I came across functional languages in university but data flow languages are still a new concept for me.
Tobias
tfritz wrote:
Another question about the "dynamically starting" of the VI:
How is the path handled? Is it guaranteed that it always takes the VI from the project or does it just search for the first VI by that name it finds in the file structure? Does this still work when building an .exe from the project? What happens if the VI is already running? Can you test for this?
While I'm at it: is there a way to stop LabVIEW from searching for subVIs it can't find when openin a VI? This resulted in very unexpected behaviour sometimes where it would find the VI somewhere else (with the same name but maybe an older version).
In my case, I just had the path hardcoded.  It is my only instance, I'm not planning on moving the VI's.  If you don't have the path, it will take a VI by that name if it's in memory.  If it isn't in memory, it starts searching relative to the calling VI's path.  One thing I know, if you are dealing with relative paths, a subVI has a different relative path in an .exe as opposed to the development environment.  The name of the .exe becomes a folder.  So in development, if your sub VI is mySubVI.vi.  In an executable, its path is MyExe.exe\MySubVI.vi
For all of this, I recommend searching the forums to get more details.
If it is searching for a VI, you can hit ignore.  But of course you'd have to do it before it finds it.  When you are dealing with versioning issues, I recommend making a backup copy of the entire directory structure elsewhere.  Some location where it shouldn't stumble across it.

Similar Messages

  • GPIB and RS232 communication problems

    I've been having several "interesting" problems with GPIB and RS232 communications in LabVIEW VIs.  Some I'll mention at the end for curiosity, but right now I'm facing a rather big problem.  I'm essentially self-taught at doing LabVIEW (using 8.5.1 right now), but by now I've had a lot of experience as their either has not been any drivers or pre-made VIs for the instruments I've needed or I've not been able to get the available drivers to work and had to write my own anyway (such as with the HP 3458A), but nothing seems to be working right now.  I'm not at work, but we typically find forum sites blocked anyway (I can't even download the NI drivers at work since they house them on a ftp server, go figures) so I can't give the VI itself (it wouldn't be easy to get approval even if I could) so the best I can do right now is in words describe everything I've tried.  I will be happy to post follow-ups of specific details if I can if they would be helpful.
    I've been working on a routine to read data from an MKS 670 Signal Conditioner/Display with a MKS 274 Multiplexer with 3 connected MKS 690A Baratrons.  Previously I've worked on programs using other older displays and the analog outputs which were being read by a DAQ card, but for a new project it was decided to try and just read the data directly.  I first worked with a unit with just an RS232 Serial Port which I managed to get to work, but had so much problems with garbage readings and having to add checks and re-reads that by the end no matter what delays I added between each reading and how simplified the command routine down to just 2 sequences and the read that it took at least 10 seconds to get 1 reading from each channel.
    Figuring maybe it was a limitation of the serial communications for these instruments I tried to re-work it for a unit with a GPIB port with which I'm actually much more familiar.  The problem is that I cannot get anything at all from the unit through GPIB.  Everything even the bare-bones built-in GPIB CLR function times out with no response from the instrument no matter how long I set the timeout limit and it also freezes the entire GPIB bus as well.  It isn't a waiting issue as it freezes on the very first command.  The GPIB initialization function seems to work (I typically find this to be unnecessary), but the instrument itself doesn't even respond with a status code.  I've also tried just the basic GPIB write functions with even just passing the <cr> and <lf> characters as well.  In Measurement and Automation Explorer most of the time the instrument won't even appear when doing search for instruments and when it does it shows as not responding to the *IDN? command (yes I've messed with the EOI, EOS, etc settings and I've even changed the GPIB address even though when it gets this far it confirms that I have the correct address) and even tried manually doing the *IDN?, *RST, and *CLR commands even with <cr> and <lf> characters which the manual for these units clearly states are compatible commands and NI SPY and everything show no response at all.  I've tried 2 different GPIB units, 3 different computers including several that are not online and haven't been updated for a while, and using older LabVIEW versions, extensive re-booting and resetting of computers and devices and still nothing.  I'm using an NI GPIB-USB-HS GPIB to USB adaptor which I've used extensively on other systems and even re-connected to those systems and everything worked fine.  When I hooked up equipment that I knew was working, it would either freeze the entire GPIB bus until well past whatever timeout setting I set at which point all the instruments would appear, but none responding to *IDN? queries or nothing would appear at all, or if I manually turned it off when frozen the other instruments would work and most even respond to the *IDN? queries.  The same goes for both of the GPIB instruments of this type that I tried and again for different versions of LabVIEW, difference computers (all Windows XP though), and every GPIB configuration setting I can find to mess with in every combination.
    Any thoughts or suggestions would be greatly appreciated.  I've had all sorts of weird problems with equipment and LabVIEW (you've got to love undocumented design features) that have frustrated me before, but I've never had an instrument never respond at all especially a GPIB one.  Getting garbage yes, no response at all, no.
    The side side issues I'm just mentioning as they may be related, but I'm really interested in the above as I have working solutions for these:
    One I've had is with a Hart Scientific (prior to being bought by Fluke) 1560 Black Stack that would continually stop responding to GPIB commands when on a continual read function taking readings just every 4 seconds with 250ms between each GPIB read or write command but for up to hours in total and the times it stops responding are random as far as I can tell.  I even started sending the *RST command before and after every read or write command and still it freezes.  The only thing is to manually turn it off and then back on or manually go through the menus and manually trigger the GPIB reset routine at which point it immediately starts responding.  However, when I got sick of having to babysit it and just decided to try the RS232 serial port (as that is all it has without the extended communications module) it works fine no problem and I can even get readings slightly faster from it.  Using a Hart Scientific 1529 Chub-e it could give me data on all 4 channels every second without problems.  I just find it a bit odd.
    When I couldn't get any of the HP 3458A driver packs to work to even give a single measurement reading and just made my own using basic GPIB read/write commands using the programming manual I still have a few interesting problems in randomly when reading off the full possible 256 bytes on the bus and clearing the bus I often find garbage partial readings on the bus every now and then.  I've added a few routines to do some basic checks, but it is annoying.  What is really weird is when just doing basic DC Voltage reads the "-" sign will randomly be dropped from some readings (started as about 1 out of every 5, down now to about 1 out of every 10).  Fortunately I'm taking several readings and averaging and taking the standard deviation with limits on the deviations and basically added a routine to say if there is even 1 negative number take the absolute value of all then make all negative, but again I find it weird.
    Thanks.
    -Leif
    Leif King
    Metrology Engineer
    Oak Ridge Metrology Center

    Greetings Leif,
    I understand you have completed extensive troubleshooting techniques to pin-point the problem with the GPIB communication. To begin, I want to ask you a few questions to help me understand your set-up and the issue at hand.
    1) Is the NI GPIB-USB-HS cable the one which cannot communicate with your instrument?
    2) When using the GPIB-USB-HS, does the GPIB interface show up in MAX?
    3) If yes, does the instrument appear in MAX after scanning for instruments (from what I understand in your issue, it does so in an intermittent manner..)?
    4) What driver version of VISA do you have installed in your computer?
    5) Are you able to communicate to the same instrument using another GPIB cable?
    Thank you for trying out some of these steps again, but we want to make sure we rule out other aspects in the systems which might be affecting the GPIB communication.
    As for your other issues, please post seperate threads for each so we can help you accordingly. Thanks!
    Sincerely,
    Aldo
    Aldo A
    Applications Engineer
    National Instruments

  • Welcome to the Design and Architecture Community

    Welcome to the Network Infrastructure Design and Architecture Community.  We encourage everyone to share their knowledge and start conversations on design and overall network topology. All topics are welcome, including requirements and constraints of the network, tools and techniques, issues of hierarchy, leading practices, services, build strategies, architectures and solutions to solve business problems.
    Remember, just like in the workplace, be courteous to your fellow forum participants. Please refrain from using disparaging or obscene language or posting advertisements.
    Cheers,
    Dan BruhnCSC Community Manager

    been waiting to see a forum like this. This forum should amalgamate all the other areas like R&S, security, DC design, and provide more quality , proven solns and discuss problems/challenges as well. Will be following this forum regularly
    thanks dan for creating this community
    Regards Kishore

  • Problem in Communication channel monitoring..

    Dear friends,
    I am facing a problem in Communication channel monitoring.
    Problem:
    I have designed several communication channels in the Integration directory.
    To check the status of channel i will go to RWB->Component Monitoring->Adapter Engine->Communication channel monitoring, then we have a selection screen to filter out the channel, adapter,etc..
    Here i am NOT seen any channels to filter out. I.e. Channels in the Integration directory are not reflecting here.
    Can you please help out on this?

    HI,
    Do the CPACache refresh .
    ALso check this SAP Note- 937382
    Regards,
    Moorthy

  • MCU Design problem

    Dear All,
    please can any one help me in my project:
    I want to design a simple communication cct. between the RS-232 port of the PC  and the serial port of the 8052 MCU, also through this cct. should I send order to the MCU from the PC to control a remot control of any device(e.g. TV), I've succeed in the section of connecting the PC with the MCU, but I can't find solution for the control of the Remote control, if my problem is not obvious just let me know,please if you can send your suggestions on the following e-mails:
    [email protected]
    [email protected]
    your efforts will be highly appreciated 
    regards

    This sounds just like what happens at our EDI department here at work. The trading partners are sending us standard documents (not XML, but still standard formats) but they all contain semantic information that needs to be interpreted differently. Or they are sending different subsets of the standard. So each trading partner's document has a transformation that maps their document into our internal standard format.
    I can see that with XML you would have the same situation. Initially you might write an XSL for each partner, but as you get farther along you should probably refactor those XSLs. You will probably find that the transformations are all quite similar, with only the details differing. So you should end up with a "core" XSL for a particular document, plus "override" XSLs for particular partners that import or include the core XSL.

  • New Network Infrastructure Design and Architecture Community

    All,
    I'm pleased to announce our new Network Infrastructure Design and Architecture Community.  In this community we encourage everyone to share their knowledge and start conversations on design and overall network topology. All topics are welcome, including requirements and constraints of the network, tools and techniques, issues of hierarchy, leading practices, services, build strategies, architectures and solutions to solve business problems.        
    Who will be the first to make it on that leaderboard?
    Cheers,
    Dan     

    Mike,
    Thanks for the kind words about the community.  It's always nice to hear the things we do make a difference. 
    Launching a scripting community has come up a few times in the past and I'm open to it.  Anyone else have thoughts on this?
    On a separate note, you'll be thrilled to hear what one of our CSC booth give-aways will be at Cisco Live San Diego next week.  Your best friend the cross-over-cable    For those of you out there attending the event be sure and stop by the CSC booth.
    Cheers,
    Dan

  • I'm using ver 4.0.1.: every search yields only 4 rows (2 pages) of images. Is this a settings or design problem?

    I'm using version 4.0.1.: every search yields only 4 rows (2 pages) of images. Is this a settings or design problem? Its not a computer problem, as I get many screens of image rows when I use Internet Explorer.

    You may want to ask this in the Dreamweaver Extensions forum or the Extension Developer's own support forum. You will likely get faster answers there.
    Brad Lawryk
    Adobe Community Professional: Dreamweaver
    Northern British Columbia Adobe Usergroup: Manager
    Thompson Rivers University: Dreamweaver Instructor
    My Adobe Blog: http://blog.lawryk.com

  • Design problem with Swing

    Hi all. I've run into some design problems when trying to create a Swing app.
    I've got a non-graphical class that emulates a power supply unit. Let's call it PSUnit. I have to create a GUI for PSUnit.
    Every class designed to build a full GUI app uses PSUnit in some way (changes its voltage, displays voltage, turns it on, turns it off, etc.)
    Here's the catch. Suppose I've got a class:
    public class BuildingBlock extends JPanel {
         // code includes a JTextBox displaying
         // the current PSUnit voltage.
    }another class is created for setting the voltage:
    public class AnotherBlock extends JPanel {
         // this class contains a JSpinner and
         // a button that retrieves the JSpinner value
         // and sets it as the current voltage of
         // PSUnit
    }When the button in AnotherBlock is clicked, I must notify the BuildingBlock class that a PSUnit has changed its state so it can update it's values and display the correct data.
    I've tried to do this a few times but failed miserably, so I'm hoping you guys could help me out.
    Please note that both of the above classes have some additional code and it's not very pleasant to make one class an inner class of another. I should be able to create a "standalone" classes which, combined together, form a GUI for PSUnit.
    Thanks.

    Yes this is a common problem that many of us have when building UIs
    Here's the question: In this instance, are these two classes really independant? Could they stand alone? Often when building a GUI, it's not even that easy to answer that question, but these leads to the two ways you can solve this
    #1. Make them independent, and use listeners either using Observable / Observer or creating your own custom listeners. The advantage of this is smaller classes and more independence. The disadvantage is it's generally more complicated, especially at the design stage
    #2 (what I'd probably recommend). Make 1 GUI class "MyPSFrame", then declare your panel classes as inner classes within that class. This way, everything goes into one spot, and everything is shareable. This also makes sense if you can't have 1 of the panels without the other.

  • Design problem about repreatable entity relationships

    Hi all!
    As I design the data model (let's name it the ERD, no matter the name is quite unfashonable), I have found almost identical structures of entities and relationships between them, but playing completely different roles in the semantics of the model.
    It obviously makes no sense to implement all such entities separately as the Entity EJB as they are to share most of the fields and methods, but I found no "handsome" solution when trying to implement them as sets of classes and interfaces forming "the abstract EJBs", and then by putting the conrete classes and complementary interfaces at the final packages to create "concrete EJBs". The problem was about types returned by the createXXX and findXXX methods, because they had to return the "abstract" EJBs but the EJB programming contract forces them to return the "concrete" ones, that are unknown to me when defining the "abstract ones". So it cancels the sense for creating them this way. It was also unclear how to operate the relationships in such model.
    The idea was:
    1. I define BaseSthLocalHome extends EJBLocalHome
    2. I define BaseSthLocal extends EJBLocalObject
    3. I define BaseSthBean implements EntityBean
    ... this way I have the "abstract bean", and then I can create many:
    SthOneLocalHome extends BaseSthLocalHome,
    SthOneLocal extends BaseSthLocal,
    SthOneBean extends BaseSthBean ... to have the first "concrete" EJB,
    SthTwoLocalHome extends BaseSthLocalHome... and so on to create the second, third and all the next "concrete" EJBs.
    Anyway, it did not work fine as I defined createXXX and findXXX methods at the BaseSthLocalHome interface - it made sense, because those methods did not depend on the other entities.
    Has anyone some idea of how to solve the design problem? Currently we are at very beginning of the project, so we have some "case study" time, and I would appreciate any solution: redesign of the data model, extraction of new EJB modules or any use of the objective inheritance.
    Thanks in advance!
    Marcin Gawlik

    Again me - I now it is a bad idea to reply for own messages, but I have just checked a new idea:
    The problem was about re-using the same components in different roles. I tried to do that by creating subclasses of the EJB classes, but it did not work. So I tried to define multiple entity EJBs that have the same class.
    Considering the given example, it would look:
    1. public interface BaseSthLocalHome extends EJBLocalHome
    2. public interface BaseSthLocal extends EJBLocalObject
    3. public abstract class BaseSthBean implements EntityBean
    ... then I created the deployment descriptor that deploys this pack of class and interfaces as three separate CMP Entity Beans:
    1. deploy BaseSthBean as the SthOne CMP entity EJB
    2. deploy BaseSthBean as the SthTwo CMP entity EJB
    3. ... and so one
    The question is: IS THERE ANY CONTRA FOR THIS WAY OF DEPLOYING EJBS? Is there any reason for not to use the same class and its complementary interfaces many times to create many separate enity EJBs working within the same EJB module?
    Thanks in advance!
    Gaw

  • Design problem/Ex​ercise Book

    Hi Everyone,
                       I am new to Labview. I just started with Labview 2011 student edition and I am following Bishop's book. But I also want a tutorial book with lots of design problems and exercises to get my skills. I am a postdoc in purdue and I started learning LabViews just because I want to learn (I am facinated by the G programming. I use it in my instrument but the departmental engineers wrote it and I want to have the same type of skills. I am also intending to become CLD). Can anyone suggest me any book or any website where I can find exercises and design problem? Thank you everyone.
    Cheers!
    Solved!
    Go to Solution.

    Ekram wrote:
    Hi Everyone,
                       I am ...Can anyone suggest me any book or any website where I can find exercises and design problem? Thank you everyone.
    Cheers!
    You found it!
    Get involved answering questions (gird up your loins) and let others hammer you into submision. Don't fall into the trap of writing code and posting VIs on demand, but rather post images of how you want to solve the posted question and let others feedback.
    Have fun!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Design problem with JScrollPane

    First, I have problems with english. I hope u understand without problems that Im trying to say here. Sorry about that.
    Mi problem is whit a JScrollPane. I want to put an image whit a predefined size for draw inside it. I dont have any information about it, just the size. I want to put it in a JPane. The best choice is use the JPane area. The problem is that I want to use a JScrollPane because the image is bigger that the visualization area.
    Im unable to put a Canvas in the ScrollPane, or a JPane whit a predefined size or an image whit a predefined size. Im sure that is a design problem. Somebody can tell me something I can start whit? What do u think is better choice to put inside a JScrollPane?
    I dont send any source code because I dont have anything else that is show in the example.
    Gracias.

    import java.awt.*;
    import javax.swing.*;
    import java.net.URL;
    public class Test extends JFrame {
      String url = "http://www.sandbox-usa.com/images/product_images/2piece_16.gif";
      public Test() {
    //    System.getProperties().put( "proxySet", "true" );  // uncomment if you have proxy
    //    System.getProperties().put( "proxyHost", "myproxy.mydomain.com" ); // Your proxyname/IP
    //    System.getProperties().put( "proxyPort", "80"); // Sometimes 8080   
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);   
        Container content = getContentPane();
        try {
          Image i = Toolkit.getDefaultToolkit().getImage(new URL(url));
          JLabel jl = new JLabel(new ImageIcon(i));
          content.add(new JScrollPane(jl), BorderLayout.CENTER);
          setSize(200, 200);   
          setVisible(true); 
        } catch (Exception e) { e.printStackTrace(); }
      public static void main(String[] args) { new Test(); }
    }

  • Design problem: Central MessagePool in WebDynpro App.

    Hi people,
    I have a design problem in my webdynpro application:
    I'm designing an application with different DC's. The architecture of the application is similar to the architecture described in the document "Web Dynpro Component
    Interface Defintions in Practice SAP NetWeaver ’04s": One root DC which manages the differnt child DC's, which contain the application content.
    Now I want to have a central MessagePool. Certain Messages in the child DCs are the same, and I don't want to have multiple MessagePool-entries for the same Message (each child DC has to define its own messages).  I can't  use the root DC as central MessagePool, because the Child DCs havn't access to the root-DC.
    Any idea, how to define and use a central MessagePool?
    Regards,
    Thomas

    Hi Thomas,
    Instead of the architecture what you are thinking try the architecture explained in the following link:
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f4d79e59-0601-0010-0689-89670315bc6b">link</a>
    Dont forget to award points on helping answers
    Regards
    sid

  • Problem of communication with compactrio

    Hello,
    I am working with a compactrio 9014 and labview 8.5
    I have a problem of communication with my compactrio. I acquire sound with NI 9215 and transmit points from the fpga VI to the VI on the real time target at a rate of 10Khz. On the VI on the RT I have two loops, one determinisic running at a speed of 10Khz (0.1ms) (in this loop I will do my signal processing) and one non-deterministic running much slower (20ms) to communicate data to my computer. To communicate data to my PC, I used shared variable.
    The problem is that if I run the VI_RT, I loose immidiately the connection. I think that is because the VI is taking up all of the execution time of the
    processor and is starving out the communication loop that is used to
    send data back to my PC.
    Because of this problem, I try to configure my compactrio to automatically run on startup of my cRIO. So I follow the steps I have read in another message in the forum posted by MattP
    To make your application (RT host VI and FPGA VI) run automatically on startup of your cRIO, you will need to do the following:
    1.  Download the FPGA VI to the flash memory on your cRIO.  If
    using LabVIEW 8, right-click on the VI in the Project Explorer Window
    and select Download VI or Attributes to Flash Memory...
    2.  Build an executable out of the RT VI.  Under your RT target 
    in the Project Explorer, right-click on Build Specifications and select
    New>>Real-Time Application.  Select the source files necessary
    for your application and any support files to be included.  Click Build.
    3.. After building the RT Application, you will find its entry
    under the Build Specifications folder in your project.  Right-click on
    the application and choose Set as startup.  Right-click again and
    choose Deploy, which will download the application to your cRIO.
    With  this procedure, I thougt that I can  run my  loop faster  because I  don't have the RT VI open on my desktop  (PC), so the PC don't have to synchronise the VI. But when I startup my compactrio, I loose connection with the target...
    So, what is wrong with my project?  Is it possible to run a loop at 10kHz on the real time processor and communicate in the same time (but every 20ms) data to my PC. Can someone explain me the right procedure to do that at this frequencies?
    I have attached my project and hope that someone can help me.
    Attachments:
    Communication.zip ‏658 KB

    Hello,
    The method you use in your application to transfer the data from the FPGA to
    the RT Host use the Front Panel Interactive Communication that write/read the
    control/indicators of the FPGA VI. This method provides also risk of Race
    Condition and use uP resources.
    To avoid errors in data caused by race conditions and use less processor resources, 
    I suggest you to rewrite this part of your application with the method 
    DMA transfer from FPGA to Host.
    You will find some good tutorial at the following address.
    What
    is the Best Method For Synchronizing a LabVIEW FPGA and a Host Interface VI?
    Best Regards,
    Nick_CH

  • SIMPLE Database Design Problem !

    Mapping is a big problem for many complex applications.
    So what happens if we put all the tables into one table called ENTITY?
    I have more than 300 attributeTypes.And there will be lots of null values in the records of that single table as every entityType uses the same table.
    Other than wasting space if I put a clustered index on my entityType coloumn in that table.What kind of performance penalties to I get?
    Definition of the table
    ENTITY
    EntityID > uniqueidentifier
    EntityType > Tells the entityTypeName
    Name >
    LastName >
    CompanyName > 300 attributeTypes
    OppurtunityPeriod >
    PS:There is also another table called RELATION that points the relations between entities.

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    check the coloumn with WHERE _entityType='PERSON'
    as there is is clustered index on entityType...there
    is NO performance decrease.
    there is also a clustered index on RELATION table on
    relationType
    when we say WHERE _entityType ='PERSON' or
    WHERE relationType='CONTACTMECHANISM'.
    it scans the clustered index first.it acts like a
    table as it is physically ordered.I was thinking in terms of using several conditions in the same select, such as
    WHERE _entityType ='PERSON'
      AND LastName LIKE 'A%' In your case you have to use at least two indices, and since your clustered index comes first ...
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Have you ever thought of using constraints in your
    modell? How would you realize those?
    ...in fact we did.We have arranged the generic object
    model in an object database.The knowledge information
    is held in the object database.So your relational database is used only as a "simple" storage, everything has go through your object database.
    But the data schema is held in the RDBMS with code
    generation that creates a schema to hold data.If you think that this approach makes sense, why not.
    But in able to have a efficent mapping and a good
    performance we have thought about building only one
    table.The problem is we know we are losing some space
    but the thing is harddisk is much cheaper than RAM
    and CPU.So our trade off concerated on the storage
    cost.But I still wonder if there is a point that I
    have missed in terms performance?Just test your approach by using sufficiently data - only you know how many records you have to store in your modell.
    PS: it is not wise effective using generic object
    models also in object databases as CPU cost is a lot
    when u are holding the data.I don't know if I'd have taken your approach - using two database systems to hold data and business logic.
    PS2: RDBMS is a value based system where object
    databases are identity based.we are trying to be in
    the gray area of both worlds.Like I wrote: if your approach works and scales to the required size, why not? I would assume that you did a load test with your approach.
    What I would question though is that your discussing a "SIMPLE Database Design" problem. I don't see anything simple in your approach when it comes to implementation.
    C.

  • How to fix comments design problem

    I have some comments that are showing on the last page and not with the correct student in crystal reports. Its a design problem because when testing it prompts me for the personid of the student i type it in and correct information is displayed for that student but in the wrong spot.
    How can i get the comments which is in a different section for the rest display on a second page but still with the correct person (im pushing it to the second page so i can duplex print)?
    Heres my sections and their page/normal configuration:
    Section 1 - nothing changed from default
    section 2 - nothing changed
    GroupHeaderSection1 - no text or anything their
    GroupHeaderSection2 - nothing their
    Section 3 (Details section) - Task, Term, Current Grade, Course, teacherdisplay
    GroupFooterSection2 - Cumulative gpa and page configuration: new page after
    GroupFooterSection1 - Comments subreport (part of report displaying the the subreport at end of the whole report instead of after GroupFooterSection2 for each person)
    Edited by: jeffman2 on Dec 1, 2011 4:38 PM
    Edited by: jeffman2 on Dec 1, 2011 4:43 PM

    Basic interface like textboxes and subreports is in crystal reports for visual studio 2010 also. I have installed the latest service packs though for the visual studio add-on. If you like I can list anything else you would need but im trying to solve my problem in the least amount of time and would be grateful for your help. What version in used in visual studio 2010 add-on?
    Also, i would like to avoid costly phone calls.
    Edited by: jeffman2 on Dec 14, 2011 7:35 PM
    Edited by: jeffman2 on Dec 14, 2011 7:38 PM
    Edited by: jeffman2 on Dec 14, 2011 7:38 PM

Maybe you are looking for