Jump to content

ShaunR

Members
  • Posts

    4,856
  • Joined

  • Days Won

    293

Posts posted by ShaunR

  1. You are correct, i am trying to generate pulses to rotate my stepper motor as a first step, my final task is a bit more complicated (sadly) . I will give the "Cont Write Dig Port-Int Clk.vi" a try and I will be back with feedback, thanks a lot.

    My final target is to:

    a) send a pulse to rotate my stepper motor

    b)after the rotation is complete i want to send another pulse to an MCA device ( multichannel analyzer) to "tell" it to start counting -the voltage coming out of a PMT tube-

    c)after the counting is done, the MCA will send another TTL pulse to inform my program that it has finished and

    d)it will also send a varying signal in the order of ~mV which i want to collect and graph in my front panel at LabVIEW.

    e) This procedure will repeat in the speed and step of my choice.

    The controlling of the MCA device is easily done by an other program called Maestro so adjusting the time that the MCA will count and sending of the TTL signal to LabVIEW is rather easy.

    I want to ask whether this is possible by modding the "Cont Write Dig Port-Int Clk.vi" or i will have to use a handshaking vi (?).

    AGAIN sorry for the super lengthy post but i believe the better you ask the question, the more likely is to get the answer you seek.

    Thank you

    It's always good to give a background on what you are trying to achieve. I means you will get a more focused answer.

    So. You just need single pulses (an event generator) rather than a pulse train.

    There are quite a few ways you can do this in labview. But I've modified the example to just give one pulse as you are familiar with the vi. It's fairly straight forward. Set the OP high. Wait a bit. Then set it low.

    For ryou incoming pulse. Take a look at DAQ events. (There is an example). You can then wire the digital out to the digital in and check to see that you can create and detect the pulses.

  2. I don't think the example is wrong either, I m probably using it the wrong way, here it is:

    That example is to demonstrate manually toggling single lines. I think you are trying to generate pulses. Yes?

    Look at the "Cont Write Dig Port-Int Clk.vi" in the examples. Change the "Pattern" to 0 and 128 and then run the vi.

  3. <br /><br /><br />

    I was just about to say that!

    Seriously though, I'm seeing a 2-3x speed improvement on my laptop (IE8) and about a 5x speed improvement on my smartphone (Opera 9). Anyone else getting a different experience when compared to the previous host?

    Surprising! Set up the "mod_expires" then it'll be really humming along.

    LAVAG NEW

    LAVAG OLD

  4. I'm not sure if it is that easy. I am pretty sure the web page must be hosted as a static document in the web service. Most modern browsers (Firefox, Chrome, and maybe IE) prevent cross-server requests, which have the potential to be dangerous. I would start by making a hello world HTML document then staticly adding it by following these directions http://zone.ni.com/r...tatic_content/.

    Then you can use ShaunR's information. If you really want to do an AJAX call simply I would look over jquery library. That is how I learned basic web page development.

    Website is back so, so read the page. From what I could see, the OP must have already done that as it is working.

    I'm ot not really sure if x-domain is relevant to that anyway. All the XMLHTTPRequest would be doing is sending a "GET" to the server on the same domain as the page was served (just as if the page was refreshed....but without refreshing it). It's not as if it would be opening an 3rd party site in an IFRAME (which is where you get problems).

    I'd be interested to learn what problems you encountered and (probably more importantly) what you did to get round it.

  5. I'll yield that you know best.

    Probably not..lol.

    I don't have much experience with streaming from the NI webserver (for example). I prefer other methods like TCPIP or websockets for that - they don't have such issues and (IMHO) offer better performance. But for normal HTTP requests (on the server side) it can be as simple as a PHP script on the corporate server that uses cURL to resend the request to the NI server and relay it back to the browser (easier than trying to get proxies and stuff authorised and set up by IT). As such, the corporate server is indistinguishable from a browser as far as the NI web server is concerned (and if you want , you can do caching and stuff too). It keeps IT happy since their portal is still the entry point and secure behind their firewalls and security policies, It obviously has an impact on performance - but it's not much for get/post methods through an Intranet, It also makes aggregation of multiple LabVIEW machines a breeze. It's one of the few scenarios where IT are actually useful biggrin.gif

  6. I'm not sure if it is that easy. I am pretty sure the web page must be hosted as a static document in the web service. Most modern browsers (Firefox, Chrome, and maybe IE) prevent cross-server requests, which have the potential to be dangerous. I would start by making a hello world HTML document then staticly adding it by following these directions http://zone.ni.com/r...tatic_content/.

    Then you can use ShaunR's information. If you really want to do an AJAX call simply I would look over jquery library. That is how I learned basic web page development.

    I cannot read that document at the moment - NI down again (might have read it in the past though). But from experience, most uses of the NI web server are to make VIs available internally within a company (managers and engineers looking at production etc - Intranet). therefore x-server really isn't an issue. When/if external access is required, usually IT insist that any requests are routed through their main servers anyway, so the browser requests it from a page on the corporate site and the request to the NI web server is sent from the corporate site. So the content seem to come from the same (corporate site) domain as far as the web browser is concerned..

  7. I have written an app for a client and included a couple web services to pull some data. Works great.

    I was wondering how difficult it is to design a simple web page that can take advantage of the web services; Specifically, how hard is it to have the user click a form button, have that call the web service and then pull data out of a specific XML field and update the page? I know this could get pretty involved, but basically I was hoping to write a simple web page with a table and update values in the table from the web service; I was hoping NOT to have to do this down at the labview level- although that might be what I have to do.

    -jed

    Easier than you might think.

    Just attach the updateData to a button Onclick event.

  8. An interesting API was recently discussed with me. Apparently you can use the ActiveX/.NET register event node to register standard LabVIEW UI events (through UI refnum). Why might this be interesting you might ask? Well for a long time I have thought that the deviation between queues/event structure was unneeded. This suspicion was reinforced when the topic came up in the CLA summit. The queue and the event structure have a lot of overlap. The question is should the two implementations be merged?

    I've talked with some who think that the event structure is more data flow oriented, but I am not entirely convinced.

    Just so you can test it, here is some example code I posted to benchmark the callback API (ActiveX/.NET) and the dynamic event mechanism

    It depends on what you mean by "merged". I use named queues rather than a named types which means that (amongst other things) I can send a string across the network and dynamically create a queue with that name at the other end.. I can't think of a way (off the top of my head) that I could easily do that with events. But generally. I think queues are easier to use since you just grab a reference by the name from any module without having to run wires or store the ref in a globally accessible storage. But apart from that. Yup. they are pretty similar (maybe because events use a queue?).

    Interesting to note that there is about 20% a difference in performance though (although I haven't looked closely at the test method)..

  9. I tried the conditional disable structure and I'm not getting the behavior I was expecting. I'm running LabVIEW 2010 SP1 (32bit) on my laptop which has Window7 Pro 64bit installed on it. I setup the conditional disable as suggested in a test VI. If I execute the VI, it is always selecting the 32 bit code in the structure. Is there something obvious I'm doing wrong or missing?

    IC.

    The conditional disable will give you the bitness of Labview you are using.

    For the OS you can use the OS.Name property node.

  10. I'm trying to determine if my application is running on a 32 or 64bit version of Windows. The application is going to be calling some external code (.exe) which has two separate versions depending on which OS they're running on. There is a very nice .NET method available which would work perfectly:

    http://msdn.microsof...8VS.100%29.aspx

    but it's only supported in .NET 4.0 which as of LabVIEW 2010 SP1 we don't have access to. I could try to write an external dll to do the check for me, but I wanted to see if anyone out there had an idea of how to do this from within LabVIEW.

    Thanks,

    Keith

    The "Conditional disable" has pre-defined conditions for different OSs (bitness is one of them).

  11. Hi, I supposed to say that the given logic wold not work. I did not check with the device though i would like to send always addresses from 0 to 127. After the logic shift this value is chnaging to some other value and i guess this make some difference.

    You can see in the below attchment for packet structure. LSB isalwyas for indicating Read/write operation. Why really logic shift is there in the given example. I did not undestand. weather it acts like what i ecpected..

    When you manipulate an integer it is always based from bit 0 i.e integer 1 = 00000001 (2^8 = 256 possible addresses). But that bit (LSB , bit 0)is used as a read/write flag. So Address 1 = 00000010 (integer 2 for a read) or 00000011 (Integer 3 for a write). Therefore the address is shifted by 1 bit and you are only using the top 7 bits (2^7 = 128 possible addresses) You can then OR your read/write flag into bit 0.

    If you were to send a U8 with the value of 1, you would in fact saying "write to Address 0". Sending. Integer 2 would be "read from address 1". and Integer 3 would be "write to address 1 etc.

    U8 (0) = 0000000 0 = read from address 0

    U8 (1) = 0000000 1 = write to address 0

    U8 (2) = 0000001 0 = read from address 1

    U9 (3) = 0000001 1 = write to address 1

  12. I think warnings are a double edged sword. For example. How many people turn off warnings on the LabVIEW error dialogue unless you are optimising? I prefer prioritised errors since the default Labview handling for errors will pop-up dialogues which then forces you to consider the seriousness of the error. It also enables you to do things like graceful degradation. Warnings, however, don't really give you much apart from the headache of documentation explaining what it means..

  13. Hello Shaun,

    That sounds like the nugget of information I need. Is windows indexing something I can turn off from within LabView? Please can you expand, I'm afraid I don't know what it is.

    Thank you,

    Martin

    I wish I could find stuff on LAVA. throwpc.gif I've commented many time before..but here we go again. biggrin.gif

    Windows indexing is the windows search service (so no, you can't turn it off in LabVIEW AFAIK). It periodically runs through the system acquiring locks on files, reading its contents (so you can search contents), and building up it's quick search database. I've been bitten many times in the past by getting file errors at seemingly random intervals and it's a killer on logging apps. I now routinely disable it and have not been bitten by random file errors since (only my own faux pas - but I can debug those rolleyes.gif)

    How to turn it off

    Try turning it off and see if your problem goes away.

×
×
  • Create New...

Important Information

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