XML Question
hodeyp
Posts: 104
The XML tools in netlinx look to be serialization type tools. Is anybody aware if I can decode a standard XML file for display on a touchpanel? (This is for streaming an EPG)
0
Comments
Unfortunitely you can only read an XML file originally made with VARIABLE_TO_XML because the result is a structure and you can't TYPE_CAST a structure.
Using VARIABLE_TO_XML you can turn a structure into XML and then put it on a file. You can get that file off the master and edit the attributes in a text editor, FTP it back onto the master, read it using XML_TO_VARIABLE and there is your new info.
I'd love a more flexible XML parser like other languages have, but I'm sure AMX have decided that java has the libraries already so if we are that keen then we can do it with DUET.
So I'm afraid you have to write the parser yourself for the specific EPG you want to read unless some friendly forum member posts one.
Does anyone know if there is a Duet module written for XML parsing yet, or will I have to do my own parsing?
What we really need is a generic netlinx xml parser. its a bit confusing at present with AMX promoting the use of DUET for device modules but netlinx being used to pull everything together. I am presuming at some point the netlinx piece will go away and the controllers will just speak java?
Is it possible to construct a string for a serial command on another machine (complete with d/p/s) and pass it to an NI via TCP (via XML, HTTP Post, etc.), have the NI relay the command to a physical device at the specified d/p/s and pass the physical device's response back to the machine that sent the original command, using either Netlinx or Java?
Thanks.
My aim is to do as much processing and variable storage on the PC as possible (essentially just using the NI as a conduit or an interpreter to help the computer speak to the physical devices attached to the NI). Can I, on the PC:
1. Create a button called Power ON.
2. Write code such that once the button is pressed, a string is compiled and sent to the NI to turn on a serial-controlled device.
3. Have the NI automatically push feedback it receives from serial devices back to the computer over the TCP connection?
If so, is the string the computer needs to compile and pass to the NI any different than what would be written in NetLinx Studio? For example, if I want to power on a receiver using 'P1P1' and the receiver is connected to the first serial port of an NI-3101 on a single master system, what would the string to be compiled by the PC need to look like?
I'm sorry if any of this is just plain wrong or silly, but this is all very new to me and I'm trying to get my head around it as quickly as possible.
Thanks.
How deep do you want to get? It sounds like the virtual keypad app would do want you want if you don't have a TP to VNC into.
If you're more comfortable with PC code, you can come up with a little Netlinx program that takes commands (of your syntax/formatting) and perhaps re-interprets/translates them before sending them out a com port to a device. If you're just as good with Netlinx, you might want to just write a fully-functioning Netlinx program and create a simple simple simple PC application that behaves more like a touch panel - when you click a button on the PC app, it sends a "button xyz was pushed" message to the Netlinx program. Same thing goes for the release of a button. Feedback would work the same - your Netlinx code determines that your display has powered on (for example) and sends a "light up button xyz" message to your PC app. The app gets that and says "okay, cool - I'll light up the 'power' button"...
Ultimately though, it's your call.
It also sounds like there's a possibility that you're making way too much work for yourself by needing to write two programs. Could you get away with connecting devices to a PC and controlling them by a single app running on the PC? Com ports are easy to come by. You can get IR driver cards and relay cards as well. No one here but you knows what you're trying to accomplish, so that may or may not be an option for you to consider.
- Chip
I'm interested in writing an app using Objective-C / Cocoa for Mac OS X. I'm much more comfortable writing in Obj-C than NetLinx (we're an AMX dealer, but we sub out our programming, so I don't know much about it).
There's another device on the market called a Waci, by Aurora Multimedia. It takes HTTP Posts and fires IR, relay, serial, etc., through to connected components. I was playing with this for a while, but don't really like the polling required to update status in the Obj-C program. When I found out that you could communicate with an AMX controller via TCP/IP, I thought that would be a more reliable, faster connection with less mess. So, I'm hoping to find a formula for creating strings to send to the AMX controller that would cause it to send IR/Serial/relays, etc. to connected equipment. Something like:
[Send_String dvRCVR, 'P1P0']
To send the string 'P1P0' to the serial port connected to a receiver (this would hopefully also return the receiver's response without being prompted for it). Or,
[Send_IR dvVCR, 'play']
to send the play command to the IR port connected to the VCR's IR emitter.
Creating formulaic strings and storing and retrieving variables in Obj-C would be much easier and faster for me, so, I'm trying to keep the NI as dumb as possible.
I've seen some serial cards and USB devices for OS X, but haven't been able to find a PCI or USB device with multiple IR emitters.