Ir al contenido principal

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).

Comentarios

Entradas populares de este blog

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…

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)