Ir al contenido principal

Entradas

Antenna pointer

Now let's get graphic!For satellite applications is always useful to know where to point your antennas. This LLB top VI draws the positions and the azimuth angle over an equirectangular projection, chosen because of its easiness (no coordinates conversion needed), though far north and south latitudes are deformed. Also provided is phi, the angle of incidence, important for asymmetric antennas.For your own calculations you'll find useful calculate azimuth.vi and calculate elevation.vi (also calculate phi.vi for angle of incidence). All of them are included in this LLB.Download (LLB for LabVIEW 2016)
Entradas recientes

Simple FTP client for LabVIEW

LabVIEW comes with its own nice pack of FTP functions, but some time ago I needed a very low level control over the communication with a particularly stubborn equipment that returned strange codes and list formats. You know, that's the problem with the FTP protocol: it was designed for human interaction and sometimes the automatization can be really hard if the server is not respecting supposed standards.So I developed some very simple VIs to see what were going down there, and now they're in this blog in case anybody needs a simple and direct way of FTP communication. The top-level functions offered are LIST, GET, PUT, DELE and RMD, the basics to manipulate files, and both active and passive modes are allowed. I think their main utility is to see how things go in the TCP chatting between client and server.Download (LLB for LabVIEW 2016)To demonstrate how they work, I have developed a simple FTP client that connects to a FTP server of your choosing and allows to navigate folde…

Implode / Explode

LabVIEW lacks native implode/explode functions for strings, to split a string into an array and vice versa. This is easily feasible thanks to the Spreadsheet String To Array function and its opposite Array to Spreadsheet String, but it's useful having a couple of VIs ready to do the work.Download explode.vi (VI for LabVIEW 2016)The explode function is pretty straightforward, but imploding is a little harder since the parallel function puts a carriage return / line feed at the end of the resulting string, and we need to remove it applying a trim. Trim is not the best function in performance and could add more problems (for example if the last chunk has a white space at the end), so I have implemented an alternative simple for-loop mechanism.Download implode.vi (VI for LabVIEW 2016)Check the code and select the mode you are mor confortable with.

SNMP library for LabVIEW

SNMP (Simple Network Management Protocol) is a fairly common protocol for communicating with network equipment. It's fast, lightweight and standardized. Unfortunately it's not quite as simple as its name implies and LabVIEW doesn't support it natively.Some years ago I was in the necessity of using SNMP from a LabVIEW system to control some hardware. I started looking for already implemented solutions and found a library developed by Mark Yedinak (great work!). It was useful since it demonstrated it could be done and how, but I needed more control over the operations, so I had to read the protocol down to the low level bytes and implement what I need by myself. Yeah, pretty hard and with time constraints no less. Anyway, here it is.Download (Library in LLB file for LabVIEW 2016)See the examples folder to grasp the basic use. Probably you'll need no more than these sets of VIs to send and retrieve data and to get traps sent by your equipment. To integrate in a program, u…

Release current directory

This is not mine, it's a tip I found years ago in a LabVIEW forum and still works like a charm (thanks to the genious that got it!).When the user selects a file to work with (signal data you want to analyze, for example) your LabVIEW application "grabs" its path, so you can't delete it or its directory, or unmount the unit if you're using an external drive, even if you are not reading that file anymore and you clear any path controls. But we can use Kernel32.dll method SetCurrentDirectoryA to release it (obviously, this only works in Windows systems).No downloadable code today, it's better if you link the call library function node by yourself, so you're sure it finds the dll. You can find more info about this method here: SetCurrentDirectory function at MSDN.

Variant to XML

Converting to XML format is a good way of exporting data in a standard, human-readable way. I have used it to pass and receive data from other languages, for example, or if you need to dump data to a log file.As you may know, LabVIEW includes its own functions for converting to and from XML, called Flatten To XML and Unflatten From XML. Unfortunately, it's a raw conversion that just gives a node with the data type and two child nodes, name and value. So, to find a field you must recover first all the name nodes, locate the one you need and then find its value sibling. Too crude for a lot of scenarios:So I developed my own library to do this conversion in a more convenient way. Check the differences in the next image:As you can see the field names are now used as tag names, resulting in a shorter and cleaner XML text. The reverse conversion (from XML to LabVIEW data) is shown in the bottom of the image, and works the same.In the block diagram, these functions are used directly, jus…

CIDR to netmask

To begin with, something basic but useful, a LabVIEW VI for converting CIDR suffix to a standard IP mask. As you know, in CIDR format the number after the IP indicates the bits that address uses. If you need to convert to a tradicional subnet mask, this VI comes handy.So, a CIDR of 24 will return a 255.255.255.0 mask, 28 is 255.255.255.240, etc. Pretty simple, but a lot of applications demand netmasks in this format.Download (VI for LabVIEW 2016)LabVIEW still only supports IPv4, so I haven't delved into the complexities of IPv6 (we'd need a U128 data type for that).