Jump to content

philips

Members
  • Posts

    9
  • Joined

  • Last visited

    Never

philips's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. (Copied from the PDA category, this one seems more appropriate!) Again demonstrating my ignorance... I am using a mapping app called OziExplorerCE on a PDA. THis comes with a simple API which I would like to use from LabVIEW - you can look at it here http://64.71.184.220/ozice/ozice_api_docs.html All I need to do is 1. Write data to a text file (easy - even I can do that!) 2. "Send a message to OziExplorer with the correct command number to do the Command" An example of this from VB is: Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 101) How can I do this from LV PDA 7.1? I had a look at an example on the NI site here: http://sine.ni.com/apps/we/niepd_web_displ...source=External This uses a Call Library Function Node which appears simple, but it appears to need a whole heap of complexity with the DLL & Visual c++ code associated with it. Is it really this complicated? Is there a simple way of doing it? Any pointers greatfully received. Cheers, Phil
  2. Again demonstrating my ignorance... I am using a mapping app on a PDA called OziExplorerCE. THis comes with a simple API which I would like to use from LabVIEW - you can look at it here http://64.71.184.220/ozice/ozice_api_docs.html All I need to do is 1. Write data to a text file (easy - even I can do that!) 2. "Send a message to OziExplorer with the correct command number to do the Command" An example of this from VB is: Result = SendMessage(OziWindow, WM_USER + 5, Me.hwnd, 101) How can I do this from LV PDA 7.1? I had a look at an example on the NI site here: http://sine.ni.com/apps/we/niepd_web_displ...source=External This uses a Call Library Function Node which appears simple, but it appears to need a whole heap of complexity with the DLL & Visual c++ code associated with it. Is it really this complicated? Is there a simple way of doing it? Any pointers greatfully received. Cheers, Phil
  3. Solved my own problem (isn't desperation a wonderful thing?). The PDA doesn't like to have the Dequeue Element connected to a Decimal String to Number conversion. I originally had (for no good reason) the elements going into the queue as strings, originally converted from an Int, so I just removed the conversion both ends and it works fine. I haven't had time to completely isolate and test this piece of code, so there could be other factors, but this looks like it.
  4. I have a PDA app built under 7.1 which runs perfectly on the PC but crashes on the emulator or on the target. It comes up with App failed. Error code 172649003. Unable to lock memory chunk. It seems to be associated with de-queuing a string (inside a state machine) and converting it to an int. If I delete this code, the error goes away, but of course my app wont work either Anybody else had this problem? Is there a definitive source of these error codes for PDA? Thanks, Phil
  5. No problem - don't rush! I got my app working beautifully yesterday thanks to your help. It now runs predictably, reliably, fast and exits cleanly. In fact I put a 200ms wait in the Receive state to slow it down so it doesn't use 100% cpu - on the PDA if you "exit" the application (as distinct from actually stopping it in LV), it just gets backgrounded but keeps chewing CPU so everything else slows down. Thanks again! Phil
  6. unless you are enqueuing into the same queue from multiple parallel VI's you should be able to confidently control the order of elements in the queue, which means you can be confident that if you enqueue two elements at once they will come out in that order. However when enqueing from multiple parrelel VI's it can cause a problem if your not careful. Another way of doing it is creating your own enque protocol i.e <state case>:<data> I would make a seperate VI with its own queued message state machine, and a reference to the main Queue. I would keep track of the time not in a while loop, but by enqueing back to the same case, when time expired enque to "send watch dog" which would enque into mains, perhaps send:<message>. I also would spawn this VI from main. Perhaps this seems to complex, but it leaves you with a lot of flexibility to grow the app. I attached a modified version of the last example that illustrates some of these points, it is by no means comprehensive, but it should get you started. hope this helps Thanks again - what is the difference between your 2 examples? I couldn;t spot it?
  7. Thanks for the example - some questions though - how is it that you can put both the state name and the message into the queue? What is you have a message which inludes by chance,one of the state names - won't it force the machine to change state? Don;t you need separate queues for state, send and receive messages? Also I need to have a watchdog message sender which sends out a message every 10 secs or so, is it ok to have a seperate timed loop which jcust generates this message and adds it to the message queue? Cheers, Phil
  8. Thanks for the replies all round - changing the tiimeout solved the immediate problem. My application is actually much more complex than this - it's a messaging system and dialler that runs on a PDA communicating with the outside world via serial port or bluetooth to a modem. I originally wrote it as a demo using parallel timed loops communicating via queues - one for serial, one for each aspect of the UI system that required different timing, but the delay thru the app was horrible and unpredictable, sometimes up to 30s between when you pushed the button and when it came out the serial port. It was my first serious LV app (this is my second!) so I'm sure there are heaps of mistakes. I decided to rewrite it using Events for the UI inside a State Machine, with queues to handle the comms between processes, notably the serial port and the UI / message handlers. However the serial will not run inside the state machine becuase the Event structure for the UI locks the machine until an event happens (I think?), so I put a timed loop outiside to handle the serial comms, and another which needs to generate data for the serial port and deal with data from it in nreal time, independent of the UI - see the attached. Any useful comments appreciated - I'm demonstrating it tomorrow at a trade show and it's far from finished since I decided on the complete rewrite only a couple of days ago. Thanks, Phil
  9. Maybe I've just been at this too long for one day, but I have 2 loops running in parallel and they have a timing dependency which I don't think should be there. The top one contains serial read / write (not using VISA becaase it's going to run on a PDA eventually) The lower one contains a simple generator to send periodic commands to the serial port (now just wired to the loop iteration counter). The generator send data to the serial loop using queues. Problem - the serial loop should just free run accoring to it's timed wait, as it has done in other VIs I've written, and 5x the speed of the Generator loop. BUT it doesn't! It only runs after each completion of the generator loop. What am I missing - probably something very simple! BTW I'm using LV 7.1 Thanks, Phil
×
×
  • Create New...

Important Information

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