I need to use/call the .NET UI Controls from inside VB6.0. Can the .NET Controls included in M Studio be enabled with COM interop to expose them to COM languages like VB6?
Using .NET UI Controls from inside VB6.0.
How to save the Line position in " Mechanical Assembly Example" due to I have many models
Hello !!
I just learned the VB using vision tool.
In the " Mechanical Assembly Example" using the VB6.
We can detect the mising part using the edge line detection.
With 1 model is ok, but i want to detect many model for our parts.
But I can not save the line detect for model by model.
Can you help me how to save the edge Line detection position for model by model.
Because with 1 model, I can insert lines to detect part, but when I closed my sofware, it can not save my line.
And if we have many model, how I can change data by model.
By support me with source code for example.
Thanks.
VB.net GPIB read is limited to 1024 characters. How can I read from instrument more than 1024 characters?
I used the sample vb program included with NI4882 drivers and the maximun size of the read command is 1024 characters. How can I read more than 1024 characters?
CWGraph plot multi lines with NI DAQ in Visual Basic 6.0
Hi,guys
Now I want to display two or more data lines through CWGraph in Visua Basic 6.0,but I just display one plot successfully.The code as follows:
CWGraph1.plotY(data)
data() is the array for data acquisition from USB 6251.
Pls help to achieve it,thank you very much.
J1939 receiving messages greater than 8 bytes
Hi,
I am trying to read DTC information from an ECU, however the DM1 message is currently 62bytes in length. Because of this the message is being ignored and filtered out (can't see message with the bus monitor either).
According to the provider of the ECU the DM1 message is not transmitted as a BAM or transfer protocol, but varies in size with varying numbers of DTC faults.
I assumed that all CAN bus data could not be greater than 8 bytes in length, but apparently this ECU does.
Note: The 62 byte DM1 message can be seen if CANalyzer is used with a propriety CAN interface.
Regards
Kevin
Measurement studio plot data vs. date/time (Measurement studio for Visual Basic 6)
Hi, I'm trying to do something that should be simple and appears totally possible but I can't get there.
I'd like to plot some data on the y axis vs. the date/time on the x-axis. I've looked at the samples, and tried modifying the chart properties but I'm doing something wrong and can't get it properly.
Any chance someone has a very simple example of plotting a few points vs. date/time that they can share?
Thanks for any feedback!!
How do you activate ComponentWorks
Hello-
I have a VB UI that uses an old version of Component Works. I recently had to upgrade the environment that builds the software and now the UI is giving me license errors when I use the controls.
The version of Component Works is 2.0.1.
Does anyone know the activation process so that my UI can use the controls in CW on a deployed pc? At the moment, all I have for this product is the original box it came in and some documentation. I am still trying to track down the install media. Of course since this is so old, it not available for download on NI's site either.
CWGraph works on Development Computer - Get flat line on Deployment Computer
I am using the CWGraph component in a VB6 application. On my deployment machine the component displayed the data as expected. The component is properly registered.
On the deployment computer, the CWGraph just displays a flat line. Any thoughts on what I need to do get get around this? Perhaps one of the components are not properly registered on the deployment computer?
Generate a programmed continuous pulse train from CTR 0 OUT by using Win7(64bit) + PCIe-6351(X-Series) + VB6
I would like to program a pulse train unit and generate it repeatingly from CTR 0 OUT port. Our environment is Win7(64bit) + PCIe-6351(X-Series) + VB6.
There are some sample code for VB6 in the NI-DAQmx 9.5.5 install CD, and I found the sample code for a continuous pulse train generation. In that sample, they use DAQmxCreateCOPulseChanFreq function for generating the pulse. It seems the frequency and duty can be changed by using this function, but the wave form can not be changed flexibly.
I was wondering if someone could teach me how to generate the following repeating pulse train as a sample. I would like to know which function should be used to set the wave form data to the buffer, and which function should be used to start generating the repeating pulse train.
- Generate 2 pulses which low time = 3us and high time = 5us,
- Generate 3 pulses which low time = 4us and high time = 6us,
- Generate 4 pulses which low time = 5us and high time = 7us,
- Go back to 1.
Thank you in advance.
Creating a Non-stop Continuous Digital Output
Hi all,
I'm trying to make a continuous digital signal that does not stop when the sub procedure that creates it ends.
I'm able to create a continuous analog signal that doesn't stop when its procedure ends by loading the necessary analog output task as soon as I pull up the .xls file, then writing values to a buffer, then stopping the analog output task, then using the WriteBinaryI16 command.
That code looks something like this.
publicStatus = DAQmxStopTask(publicAnalogOutTaskHandle) publicStatus = DAQmxWriteBinaryI16(publicAnalogOutTaskHandle, DACwaveFormSize, True, 5, DAQmx_Val_GroupByScanNumber, buffer(0, 0), publicSampsPerChanWritten, ByVal 0&)
Can I use much the same procedure to output a nonstop continuous digital signal? For what it's worth, I'm using an PCI-6259 DAQ card that is connected to an SCB-68 connector block.
Thank you,
Armando83
read and write analog fast varying signal simultaneously using Ni 6008 + vb6 code
i want to write analog fast varying signal to AO same time I want read analog signal simultaneously each after 10 millisecond I am using vb6 platform.
Kindly help...
In VB6, how do I pass the array returned by ImagetoArray() to a C++ function by reference not by value?
I have been puzzled by the problem for days, and your help is sincerely appreciated.
I use VB6 and a NI1430 board to grab images from a UNIQ1830-CL camera. After the image is obtained, I use ImageToArray to get the data, and pass the array to a C++ function to do centroiding for a subregion of the image. The C++ function resides in a custom-made dll named 'mathLib'.
The signature of the C++ function is:
STDMETHODIMP Cmath::centroid(VARIANT *image, int left, int width, int top, int height, VARIANT *theCentroid) ;
To call the C function from VB6, I do:
dim centroid as variant
dim imageData as variant
...
let imageData = CWIMAQImage.ImageToArray
Let centroid = mathLib.centroid(imageData, regionLeft, regionWidth, regionTop, regionHeight)
...
I tried the NI1430 and a board from another company. The 'imageData' look the same in VB6 - both are 2D Integer arrays of size 1024x1024. However when the array is passed to the C++ routine, there is a 5 times difference in processing speed. I examined the array on the C++ side. It turns out that the 'vt' field has different values. For the array coming from NI1430, vt = 0x2002 (i.e. VT_ARRAY & VT_I2), which incates it's passed in by value. While for the array coming from the other board, vt = 0x6002 (i.e. VT_BYREF & VT_ARRAY & VT_I2), which says it's passed by reference. Since I call the C++ function for many sub regions in the image, and each call results in a new copy of the NI image array, the slowness in speed for the NI board is profound.
So my question is: In VB6, how do I get a reference to the array returned by ImagetoArray() ? I've tried to obtain the address of the array, pass the first element of the array, etc. none of them worked. Please help.
simultaneous read & write fast varying analog signal
Hello!
I am using USB 6008 Device to Read and Write analog signal.
I want to write analog output on channel exactly after each 10 millisecind and also read input on mutiple channel on each 10 millisecond.
I did code tested but cannot attempt time as I expected.
kindly help me !!!
GP-IB リモート/ローカル切り替え
GPIB-USB-HSを使用しGP-IB機器を制御しています。
リモート/ローカルの切り替え関数(EnableRemoto/EnableLocal)の第2引数の説明を教えてください。
Vbib-32.vasプログラム内上記関数があります、第2引数がaddrs() as integerとなっています。
本引数は、上位側から渡す情報なのでしょうか、それとも実行した結果何らかの情報が返ってくるのでしょうか
上位側から渡す場合は何を設定すればよろしいですか。
请问利用VB6.0进行NI采集卡控制的步骤
请问利用VB6.0进行NI采集卡控制的步骤,NI-DAQmx x.x版本有何区别?
LIN crashes labview
I am having trouble using and .ldf file to read the state of charge on a battery. I am using an example LIN .ldf that I am using after reading this forum:
https://decibel.ni.com/content/docs/DOC-5135
Each time I open the example ldf file, it works fine. But when I load my ldf file, it crashes the program. Below is a copy of my ldf file.
I am running with a USB -8476 LIN bus monitor. I am using an LDF file with protocal version 1.0. I am also using a simple example that is supposed to load a .ldf file and read it's contents. In this case, it would display battery state of charge.
Any suggestions?
Simultaneous Digital Write and Read w. Interval Measurement
Hi all,
For the past couple days, I've been wracking my brain trying to get a program to work.
I'm trying to generate a 4-bit digital output while simulatanously counting the rising edges on its LSB up to an arbitary number set by the program's operator, at which point, the program would make a measurement.
I'm noticing, though, that, over a certain rising edge count number (~950 or so), the program crashes. The problem persists even when I remove the function that reads the LSB, although, in that case, the crashes occur at a much higher number. What might cause this? Is there any way I can work around this problem?
Below is my code:
arraySizeInBytes2 = 8 bufferSize = 255 ReDim readArray(arraySizeInBytes2) publicLifetime = 100 ' use this to control the length of time the task takes numSamplesToWrite = 10 * publicLifetime * numSample * 5 numSamplesInArray = 5 * 10 * numSample 'code that defines the digital and analog output signals j = 0 k = -1 Do While j < numSamplesInArray If j Mod SampPerCycle = 0 Then k = k + 1 Else k = k For m = 0 To 3 If ((k) And (2 ^ m)) = (2 ^ m) Then writeArray(m, j) = 1 Else: writeArray(m, j) = 0 Next m j = j + 1 Loop publicStatus = DAQmxCreateTask("", taskHandleDigitalOut) publicStatus = DAQmxCreateTask("", taskHandleAnalog) publicStatus = DAQmxCreateTask("", taskHandleDigitalIn) taskIsRunning = True publicStatus = DAQmxCreateDOChan(taskHandleDigitalOut, "Dev2/port0/line0:3", "", DAQmx_Val_ChanForAllLines) publicStatus = DAQmxCfgSampClkTiming(taskHandleDigitalOut, "Ctr0InternalOutput", 1000000#, DAQmx_Val_Falling, DAQmx_Val_AcquisitionType_FiniteSamps, numSamplesToWrite) publicStatus = DAQmxCreateAOVoltageChan(taskHandleAnalog, "dev2/ao0", "", -10, 10, DAQmx_Val_VoltageUnits2_Volts, "") publicStatus = DAQmxCfgSampClkTiming(taskHandleAnalog, "Ctr0InternalOutput", 1000000#, DAQmx_Val_Falling, DAQmx_Val_AcquisitionType_FiniteSamps, numSamplesToWrite) publicStatus = DAQmxCreateDIChan(taskHandleDigitalIn, "dev2/port0/line7", "", DAQmx_Val_ChanPerLine) publicStatus = DAQmxCfgChangeDetectionTiming(taskHandleDigitalIn, "dev2/port0/line7", "", DAQmx_Val_AcquisitionType_ContSamps, 8) publicStatus = DAQmxWriteBinaryI16(taskHandleAnalog, DACwaveFormSize, False, -1, DAQmx_Val_GroupByScanNumber, buffer(0), sampsPerChanWritten, ByVal 0&) publicStatus = DAQmxWriteDigitalLines(taskHandleDigitalOut, numSamplesInArray, False, -1, DAQmx_Val_GroupByScanNumber, writeArray(0, 0), sampsPerChanWritten, ByVal 0&) publicStatus = DAQmxStartTask(taskHandleDigitalIn) publicStatus = DAQmxStartTask(taskHandleAnalog) publicStatus = DAQmxStartTask(taskHandleDigitalOut) publicStatus = DAQmxStartTask(publicCounterHandle) r = 0 Do While r < (publicLifetime * numSample) publicStatus = DAQmxReadDigitalLines(taskHandle, 1, 5, DAQmx_Val_GroupByScanNumber, readArray(0), arraySizeInBytes2, SampsPerChanRead, numBytesPerSamp, ByVal 0&) If publicStatus = 0 Then r = r + 1 If r Mod publicMeasurementInterval= 0 Then 'Measurement Code here Loop publicStatus = DAQmxStopTask(taskHandleDigitalIn) publicStatus = DAQmxWaitUntilTaskDone(taskHandleDigitalOut, -1) publicStatus = DAQmxClearTask(taskHandleDigitalOut) publicStatus = DAQmxStopTask(taskHandleAnalog) publicStatus = DAQmxClearTask(taskHandleAnalog) publicStatus = DAQmxStopTask(publicCounterHandle) publicStatus = DAQmxStopTask(taskHandleDigitalIn) publicStatus = DAQmxClearTask(taskHandleDigitalIn) taskIsRunning = False
Thank you.
How can I programmatically change the fill color Settings of the Cwslide ActiveX Controls
In design mode (Visual Studio 6.0),I want to programmatically change the fill color in properties of cwslide ActiveX Controls.what's the command?
use USB-6501 output like a chopper circuit
I’m terribly new to this sort of thing so forgive me if my questions seem trivial. I’m looking for VB code that allows me to pulse the outputs on the USB-6501 24pin I/O. Or, is it possible to view/edit the code that that MAX uses in its test panel ?
If any of these are possible, could someone point me to a link please? I’m trying to edit the output so that I can make the ports behave like a chopper circuit (ie. Pulse the output high for 25ms, low for 75ms. My expected result would be 25% of ttl voltage or read from a meter connected to the output – 1.25V rms). Does anyone see a problem with this?
How to generate analog pulse using ni usb 6009
hello,
I need to control the on and off of a trasistor, for that i need to give a on pulse with 1ms and off pulse of 360ms using ni usb 6009. is there any example vi for that.