Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Beginner: Convert number to binary

Hi,
I've just started using LabView and I have to admit I'm struggling a bit. I'm trying to re-create some functionality I implemented in Simulink, which is:
I have a .csv file containing hex values. I want to convert these values to binary then use the value to set the frequency of a sine wave (ie to do fsk). My question is:

- How do I convert an array of hex values into 8 bit wide binary values

I realise it's a very simple problem but this is a new way of working for me & I can't figure it out!

Thanks for any help,

Martin
0 Kudos
Message 1 of 22
(4,490 Views)
Sorry I should have said, I want to create an array of binary values, with a 1 or 0 in each cell, so that I can use the values to switch frequencies.
Thanks,
Martin
0 Kudos
Message 2 of 22
(4,486 Views)
I'm not sure how you are doing the FSK but there is a function in the Numeric function set that converts a U8 to a boolean array. Is this what you are looking for?

Menus: Numeric->Conversion->Number to Boolean Array
Randall Pursley
0 Kudos
Message 3 of 22
(4,480 Views)
Hello Martin,

Heres how you do it, this is only a single scalar hex value so you will need to do lots more array manipulation in order to perform an array of hex values but I am sure you can work it out from there.

Hope this helps its in LV7.1 format

Kind Regards

Steven Bird
Applications Engineer
National Instruments
0 Kudos
Message 4 of 22
(4,451 Views)
Thanks very much. Unfortunately I only have 7.0 and not 7.1 installed so I cannot open the file, however I have now got a way of doing it.
Thanks,
Martin
0 Kudos
Message 5 of 22
(4,449 Views)

Good Evening

I have a question for you?

I'm using SIT 3.0 with LabView 8.2. I need to insert a Sine Wave in Simulink and Change the frequency, the bias, the amplitude in LabView.

if I use the mapping i can see the Port1 corresponding but when I connect them and launch the VI the control connected with this parameters become grey!

Someone could help me?

Thanks Odryx

0 Kudos
Message 6 of 22
(4,099 Views)
Hi,
 
Are you using SIT 3.0.2? According to this document, this version is necessary for support with LabVIEW 8.2, not just SIT 3.0.
Amanda Howard
Americas Services and Support Recruiting Manager
National Instruments
0 Kudos
Message 7 of 22
(4,090 Views)
the SIT Version that I'm using is 3.0.3.
 
I have another question. When I stop the execution of VI on the AO remain the last Value of the simulation.
How can i do to reset to zero the output?
It's very dangerous that the physichs channel remain operative.
 
Thank you very much
0 Kudos
Message 8 of 22
(4,080 Views)
Odryx,

disabled and greyed out controls occur if you have the following options in the Simulink development environment enabled:
- Signal Storage Reuse
- Block Reduction Optimization

You can find these options in the Simulation environment settings.
To get an idea what these options are good for, please read the Simulink help.

Concerning the post in the other thread, please be a bit more specific what you gonna try to achieve.

To answer the 2nd question it would be more helpful to know whether you are working with the MDL or DLL version of your simulation model.
In both cases you need to add your custom code to the end of the dataflow to set the output to zero (DAQmx Write = 0).
To be more specific I need more information from your side.


Thanks,
ThSa


Message Edited by ThSa on 02-02-2008 01:25 PM
0 Kudos
Message 9 of 22
(4,072 Views)

Hello Thsa I try to explain my situation at best that I can. I need to develop a position control for a pneumatic actuator

by using, for example, the Simulink model attached below (Controllo_Andrea.mdl).

Opening the file it’s possible to see a Sine wave Block.

 

At this point I load the mdl file in LABVIEW, using SIT. The model must work on a TARGET (exactly a Desktop PC used like a PC TARGET). So I’ll use the ddl file.

 

I’d like to generate the reference signal in LabVIEW for two reaseons:

-          the first is that actually I don’t know which tipe of Signal I’ll utilize

-          the secondo one is that making so I could split the control  part (develop in Simulink) by the signal generation (made in LV).

 

Making so I could enjoy of the same structure for different model

 

I know how to generate a signal (figure1.bmp, figure2.bmp) but I don’t understand in which way to comunicate at the model that it must utilize the LV signal.

 

Thank, thank, thank

0 Kudos
Message 10 of 22
(4,056 Views)