Quantcast
Channel: LabWindows/CVI topics
Viewing all 5349 articles
Browse latest View live

DAQmxAddGlobalChansToTask to allow scanning channel twice

$
0
0

Hi,

 

I was wondering if this would be the correct syntax to allow sampling a channel twice in a scan list:

for (row = 1; row < numrows; row++)
{
   strRow = getstring(row);
   DAQmxCreateAIVoltageChan(task, phychan, strRow, .......);
}

DAQmxAddGlobalChansToTask(task, "1");   // adding row=1 channel to end of scan list

 

Note that we only need to add one virtual 'row'  to task.

 

Thank you.


ivi driver development

$
0
0

I am a new user and developer of LabWindows/CVI.   I am attempting to create an IVI-C device driver and User application for a new instrument (board with embedded SoC), which I would like to make flexible enough that I can easily modify it to use either a Ethernet or Serial interface to the board.  I'm using LabWindows/CVI because I have been asked to integrate this application into the CVI environment.

 

I've downloaded CVI 13.0 and gone briefly through the IVI Instrument Driver Wizard to create the shell of an IVI Specific driver.  But it is including 'ivi.h', which doesn't seem to be in my CVI installation or in the IVI foundation library installation.

 

Is there another package I need to install to begin creating the driver?

Is there a particular VISA installation that I need to provide the serial (and enet?) interface functions?

 

I have the LabWindows/CVI Instrument Driver Developers Guide, and have been reading it to try to understand how to complete a starting driver.   But seem to be missing some pieces.

 

Still trying to figure out how these pieces fit together to get started.

 

error when file name with accent passed to GetFileDate()

$
0
0

Hi,

 

When i pass a file or a file that belongs to a path that has one of its folders names containing an accented character to GetFileDate(), i get a Library function error (return value == -1). For example all files within the folder 'Eéprom' return an error. Can anyone please offer some help on how i resolve this issue?

 

Thank you!

 

(LabWindowsCVI 9.0 / Windows 2000 / CVIRTE2009)

Artificial Data found when reading AC voltage

$
0
0

I'm using card 6210 to scan AC voltage using NI sample code = ContAcq-IntClk.prj

This is the output when AC is switch on.

 

normal.PNG

 

 

Afterwards, when I swith off immediately. I found the output becomes like this. Look at the plotting in red circle. Please advise what was happened.

 

01_edit.PNG02_edit.PNG

 

 

 

How to add watermark in document using NIReport? In Labwindow CVI.

$
0
0

Hi all,

 

In Labwindow CVI,  I am using NIReport API to create document(pdf).  I need to add watermark  in Document.

 

How to add watermark in document using NIReport?

 

 

Thanks

Mukesh Kumar

         

Webservice call in LabVIEW-DLL

$
0
0

Hi everyone

 

What I already do is calling a webservice (SAP BAPI) with LabVIEW in order to get some information from the ERP. To do this, a DLL call is required and it always works fine.

Now I'm looking for a LabWindows/CVI solution for this, so I built a shared library out of the LabVIEW-VI which contains the BAPI call. Now I have a DLL which calls a DLL, and obviously it doesn't work this way. No meaningful data is returned from the built LabVIEW-DLL, so I must assume that entire VI is not called properly. Even when I wire a constant value to the output "daten" for debugging purpose I won't receive it as long as the subVI containing the DLL call is enabled within the LabVIEW-DLL. As soon as I disable the subVI is disabled the returned data is ok.

When I call the DLL with LabVIEW instead of CVI everything works fine.

Anyone faced this problem too?? After a long web research I have no idea what to do...

Many thanks for your help!

 

Thomas

LabWindows/CVI myDAQ

$
0
0

Hello i need to know if somebody have used the ni myDAQ for audio sampling, I saw an example to do it but in labVIEW and I want to do it on labWindows/CVI, the problem here is that I try to use the DAQmxCreateAIMicrophoneChan and the channel audioInputLeft or audioInputRight are not supported...

can somebody help me?

Functions in File

$
0
0

1) I have tried finding a description in the help using the tooltip text displayed for this ring popup, i.e. Functions in File. No success, neither index nor search. Since many years I am asking for an improved help - until now the 'help' search only succeeds if you hit the exact term...

 

2) Functions in File only seems to work for source code files that have been added to the project - if I (temporarily) load a source file into a project the ring is not populated. According to the release notes it should: "LabWindows/CVI creates source code browse information for functions that are declared
even if they are not called in the project." And even if I misunderstood the release notes: it should... Environment setting On edit / on compile does not make a difference.

 

By the way, any hope for a SP?


what should be in Resource Descriptor

$
0
0

I am new to LabWindows/CVI, so please forgive my ignorance, but I've been struggling for several days with the very basics of creating an IVI Specific Driver, using the IVI Instrument Driver Wizard tool, and getting nowhere.

 

I am trying to create the most simple Serial IVI driver I can, to see if I can get some communication flow from a test app created with CVI on a PC to a new device, which is a SocKit evaluation board with an SoC and some on-board I/O interfaces.  The new instrument has a serial port and an Ethernet port... ultimately I'd like a driver that can connect to either.

 

I'm using the IVI Instrument Driver Wizard to create the serial driver.... using CVI 13.0.

 

When I get to the 'Test' page of the Driver Wizard, it asks for a Resource Descriptor, and provides the default of "ASRL1::INSTR". 

 

My question is where am I supposed to get this descriptor?

 

My device is connected to COM4 (which is a USB Serial Port with an FTDI driver installed to convert USB to serial...).    I know that communication on this port from the PC to the device works, because I can set up a putty terminal connection and connect to a linux 'sh' program running on the board.

 

Currently I just want to test this driver to see if the device sees any 'receive' data on its serial port ... so I've told the driver that I want it to send an Identification Query as part of the Initialization.

 

If I keep the default Resource Descriptor of ASRL1::INSTR, and select 'Run Tests...', I'm fairly sure that no communication is going across COM4... I dont' see any Rx LEDs light up on the device.   But the tests act like they're trying to communicate with something, and eventually return with the following:

Serial Port Configuration
...Passed
VISA Initialization
Return Code : 0x0 (VI_SUCCESS: No error)

ID Query
Return Code : 0xBFFF0015 (VI_ERROR_TMO: A timeout occurred)

 

I've change the Resource Descriptor to "ASRL4::INSTR", and also tried "COM4", to see if I can see any Rx LEDs light up on the device... but in any of these cases, when I click 'Run Tests...', CVI immediately returns with an error message...

Could not get the board number for the given interface. (VI_ERROR_INV_RSRC_NAME: Invalid resource reference).   

So one problem is that I don't know where I'm supposed to get a valid Resource Descriptor to try communicating across the PC's COM4 port ??

 

I've also tried building and installing this driver, and running NI MAX.

Within NI MAX, the new driver shows up under IVI Drivers->Advanced->Instrument Driver Software Modules.

 

But it does not show up anywhere else (e.g. under "Devices and Interfaces", or "IVI Drivers->Driver Sessions").   I don't know if this is something I need to fix first before expecting to provide a valid Resource Descriptor, or really what to try next.

 

Just to be clear, I don't have any communication software specifically set up to run on the device... but it has a built-in Serial communication capability, and as mentioned above, this has been tested by connecting to an embedded linux 'sh' app running on the device, using putty on the PC.

I'm hoping I can verify that I have a mechanism for communicating through an IVI driver to the device, before putting an IVI/Visa compatible app on the device that provides the desired communication interface.

 

 

 

 

SLD overwriting

$
0
0

I'm trying to generate a function panel using the 'generate function tree' option.  I need two SLD (slider) bars, but seems to only take the last SLD defined.

 

The snippet below will correctly show the SLD with the correct FmtWinOpt enums

 

   ///HIPAR 7/Format with which to evaluate the passed in value
   ///SLD 7/FmtWinOpt

 

but if I change it to

///HIPAR 7/Format with which to evaluate the passed in value
///SLD 7/FmtWinOpt
///HIPAR 8/resolution to be used when printing the number to the screen
///SLD 8/Precision

 The slider for parameter 7 no longer shows (though the help is still correct) and now I have a slider for parameter 8 showing correctly.

 

Is there's something I'm missing or am I only allowed 1 slider per function?

 

Thanks

FileExists() to take into account letters in Caps?

$
0
0

Hi,

 

I am using this function FileExists(&file_name,0) and would like to know if there is a way to make it take into account capital letters as well? For exaple file names file1 and File1 should not return FileExists as positive. 

 

Thank you!!

 

Sinnas

Flash memory

$
0
0

Hello Everybody ,

 

I am a newbie in CVI labwindows so I learn everyday.

 

I have a VTI chassis for multiplexer and DMM (digital multimeter) . I would like to configure my chassis and after the switch off , it can keep the previous configuration i want. I dont know how to access to flash memory under CVI . Can you help me about this?

 

thanks

Mysql database connection with Labwindows/CVI 2009 sql toolkit

$
0
0

Dear experienced users,

 

I am using the following software/hardware:

 

  • Windows 7/ Mysql database 5.6.15 64-bit with MySql ODBC 5.2 Ansi driver installed
  • Labwindows/CVI 2009 with sql toolkit
  • The user DSN of ODBC Data source administrator have been confiugred to one of mysql database. The test MYSQL Connector/ODBC is succesful.
  • The Labwindows/CVI build setting is configure to debug64 after trying debug (32)
  • The source code is from the example readtab.c with changes to the dsn I am testing

    hdbc = DBConnect ("DSN=dvd_collection");   

 

The error message I have is confusing me.

 

(it is in the attachd png)

 

 

I thought it was due to the 64 bit mysql database. That's why I tried the 64 bit build from Labwiondws/CVI. I alsow tried Labview DB tools open connect.vi. It shows me the same error.

 

Any suggestion is appreciated.

 

Thanks,

 

Jimmy

 

 

Updating code after changing UIR

$
0
0

How do you update your source code (.c) and header file (.h) after making changes to your user interface (.uir) without wiping out previously written code?

 

This happens if I hit Code > Generate All Code and even then, my .h file does not reflect the changes made in the UI.  How can I update the .h file and only add new code to the .c file?

 

PS, it would be cool if the UI function panels had a drop-down list for the ControlID argument listing the controls that have been defined.

 

Thank you.

CVI window tab order

$
0
0

Is there a way to maintain the order of the tabs of CVI windows?

 

Let's assume my project consists of three source code files, one UIR file, and two include files. All are loaded into the editor so that I can easily switch between them by clicking on the respective tab. Let's assume I want to have the tabs of source code files arranged to the left of the tabs of the include files...; whereas I can rearrange the tabs to my liking, it appears that when I quit and restart CVI this order is lost... It appears that rearranged tabs are not saved in the CWS file.


ClientTCPRead() read after a ClientTCPWrite() without event callback TCP_DATAREADY doesn't answer when i open a second panel with RunUserInterface()

$
0
0

Hi at all and thank to anyone that will answer

 

here is my problem.

 

i have a function in a 0.025 ms timer implemented in this way

 

int CVICALLBACK UpdateKollmorgen(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
	static int timer_kollmorgen_occupato = 0;
	switch (event) {
		case EVENT_TIMER_TICK:
			if(timer_kollmorgen_occupato == 0){
				timer_kollmorgen_occupato = 1;
				gestione_kollmorgen(0);
				timer_kollmorgen_occupato = 0;
			}
			break;
	}
	return 0;
}

 

in this function i have a call to a modbus driver that i have write personally and it is this code, with other part that i've cutted

 

int gestione_kollmorgen(unsigned short int quale_kollmorgen)
{

	// gestione errore
	unsigned char ReadBuffer[2000] = {0};
	int error_number = 0;
	char error_title[40] = {0};
	char error_string[760] = {0};
	static int numero_ciclo[2] = {0};
	
	///////////////////////////////
	// eseguo un loop di letture //
	///////////////////////////////
	error_number = ricevi_kollmorgen(numero_ciclo[quale_kollmorgen], quale_kollmorgen);
	// se ho un errore salto al case di pulizia buffer
	numero_ciclo[quale_kollmorgen]++;
	if (error_number != 0){
		goto error;
	}

	if(numero_ciclo[quale_kollmorgen] >= 5){
		numero_ciclo[quale_kollmorgen] = 0;
	}

	// altrimenti esco
	return error_number;
	
error: 
	// se ho un errore converto il messaggio, faccio il log e mostro un popup
	Modbus_TLGB_TCP_ErrorTranslation(error_number, error_title, error_string);
	Modbus_TLGB_TCP_Log_Errori(file_address_log[quale_kollmorgen], error_number, error_title, error_string);
	MessagePopup(error_title, error_string);

	// eseguo una lettura per svuotare il buffer
	SetBreakOnLibraryErrors(0);
	ClientTCPRead(g_hconversation[quale_kollmorgen], ReadBuffer, 2000, 5000);
	SetBreakOnLibraryErrors(1);

	return error_number;
}	   

 

this function then call 

 

int ricevi_kollmorgen(int numero_ciclo, int quale_kollmorgen){
	int error_number = 0;
	switch (numero_ciclo){
		// se si aggiunge un case bisogna sistemare anche il ciclo for nella gestione_kollmorgen
		case 0: // leggo DRV_ACTIVE e DRV_MOTIONSTAT
			error_number = Modbus_TLGB_TCP_ReadHoldingRegister(g_hconversation[quale_kollmorgen], 220, 50, result_sint[quale_kollmorgen]);
			if (error_number == 0){
				// se va tutto bene converto i risultati
				kollmorgen[quale_kollmorgen].DRV_ACTIVE = result_sint[quale_kollmorgen][221];
				kollmorgen[quale_kollmorgen].DRV_MOTIONSTAT = convert_2_short_int_to_1_int(result_sint[quale_kollmorgen][268], result_sint[quale_kollmorgen][269]);;
			}
			break;
		case 1:
		-----------some code after--------
			break;

	}
	
	return error_number;
}

 

and finally my modbus driver where after creating a buffer i read the answer and decode in this way

 

	SetBreakOnLibraryErrors(0);
	Status = ClientTCPWrite(ConversationHandle, WriteBuffer, WriteBufferTotalLength, 5000);
	SetBreakOnLibraryErrors(1);

	if (Status < 0) {
		return Status;
	}

	//////////////////////////////////
	// fase di lettura e decodifica //
	//////////////////////////////////
	SetBreakOnLibraryErrors(0);
	while((ReadBufferToBeReadLength > 0) && (Status > 0)){
		Status = ClientTCPRead(ConversationHandle, &ReadBuffer[ReadBufferTotalLength - ReadBufferToBeReadLength], ReadBufferToBeReadLength, 5000);
		ReadBufferToBeReadLength -= Status;
	}
	SetBreakOnLibraryErrors(1);

 

the problem that i have is that when i am in the main page of my software, the one that include the timer, everything work correctly.

when i open a subpage that have a RunUserInterface() the ClientTCPRead() stop answering and the timer freeze and restart when i close the page.

this happen only if i open the page when the software is doing a reading and not if the cicle have finished, i try to explain better.

if i control with the flag

 

	static int timer_kollmorgen_occupato = 0; 

if the timer is working or not and then i open the page, if the flag is = 1 so the timer is doing a reading this will stop, if i open the page with the flag at 0 there are no problem and the timer will continue working correctly.

 

i have done this only to check if i have some disconnection

 

int CVICALLBACK Modbus_TLGB_TCP_CallBackFunction(unsigned handle, int event, int error, void *Void_Pointer_to_Flag_ConversationHandle)
{
	int *Int_Pointer_to_Flag_ConversationHandle;
	char file_address_log[260] = {0};
	char error_title[40] = {0}, error_string[760] = {0};
	switch (event) {
		case TCP_DATAREADY:
			break;
		case TCP_DISCONNECT:
			GetDir(file_address_log);
			strcat(file_address_log,"\\LOG_MODBUS.txt"); 	
			Modbus_TLGB_TCP_ErrorTranslation(-14, error_title, error_string);
			MessagePopup(error_title, error_string);
			Modbus_TLGB_TCP_Log_Errori(file_address_log, -14, error_title, error_string);
			Int_Pointer_to_Flag_ConversationHandle=(int*)Void_Pointer_to_Flag_ConversationHandle;
			*Int_Pointer_to_Flag_ConversationHandle = 0;
			break;
	}
	return 0;
}

 can somebody help me?

DDC_saveFile-Problem

$
0
0

hi all,

 

we use the nilibddc.dll to build and handle tdms-files. till now all worked fine, but:

 

if I delete a channelgroup from the file I am not able to store the file anymore. deleting-command itself (DDC_removeChannelGroup()) does not produce an error. the DDC_saveFile-command throws an exception (see below).

 

a little snippet to illustrate the problem. most is C++-stuff using Qt-framework, look for //--> to see the problem.

 

thanks and best regards

 

Simon

 

int CubeExperiment::removeDbFromExperiment(const QString& sName)
{
int ret;

bool bCloseAfterCheck=false;
if(!this->ddcfileHandle)
{
bCloseAfterCheck=true;
ret=this->open();
if(ret) return ret;
}

unsigned int usIntChannelGroupNumber;

//Get group number
ret=DDC_GetNumChannelGroups(this->ddcfileHandle,&usIntChannelGroupNumber);
if(ret) return ret;
if(!usIntChannelGroupNumber) return 0x00;

//Get group handles
DDCChannelGroupHandle* channelGroupHandles=0x00;
channelGroupHandles=new DDCChannelGroupHandle[usIntChannelGroupNumber];
ret=DDC_GetChannelGroups (this->ddcfileHandle, channelGroupHandles, usIntChannelGroupNumber);
if(ret) goto cleanUp;
{
QByteArray helper;
char* pcName=qStringToPchar(sName,helper);

//Work groups
for(uint ix=0; ix < usIntChannelGroupNumber; ix++)
{
char buffer[EXP_MAY_PROPERTY_LEN];
ret=DDC_GetChannelGroupProperty (*(channelGroupHandles+ix), DDC_CHANNELGROUP_NAME, buffer, EXP_MAY_PROPERTY_LEN);
if(ret) goto cleanUp;
if(!strcmp(buffer,pcName))
{
//-->The following is worked without an error...
ret=DDC_RemoveChannelGroup (*(channelGroupHandles+ix));
goto cleanUp;
}
}
}

cleanUp:

if(bCloseAfterCheck)
//-->The following line calls DDC_SaveFile() --> and the error messages beneath appear...
ret=this->saveAndClose(true);


//Exception at 0x74c2c41f, code: 0xe06d7363: C++ exception, flags=0x1 (execution cannot be continued) (first chance) in uspTdms!USI_130_USP

return ret;

no update from textbox with inserttextboxline or resettextbox command

$
0
0

Maybe there is an attribute to configure. After a command with inserttextbox or resettextbox, there is no update on the textbox display. But if I run displaypanel again, the new text shows up in the textbox. Why the response of textbox is delayed or skipped?

 

Thanks,

Jie.

Lab windows GUI and NI Labview RT Module Application Interaction

$
0
0

Hi All,

 

I have a developed a Real time application using Ni Labview. In this I have developed a GUI using NI Labview and RT Module in Labview. 

Iam able to read and write data from HOST PC GUI to the RT Module applications. I am exchanging the data between GUI and RT Module using the shared variables.

 

Now I want to recrate the GUI using the Labwindows. I still want to use the RT application developed in NI Labview.

So Previously GUI was build in Labview and RT Application running on RT Target is also built in NI Lab view.

 

Now I want to Create the GUI in NI Lab Windows CVI and still use the RT Application build in NI Labview.

Is it Possible to do it. 

Can any provide any links.

 

Waiting for your replies.

 

Ramesh.

ServerTCPWrite

$
0
0

lets say i have

int x[50];

char str[20];

on both server and client computre

 

how can i use ServerTCPWrite, one time to send x and one time to send str?

if i use in the server:

ServerTCPWrite (ClientHandle, x, 50, 0); 

ServerTCPWrite (ClientHandle,str, 20, 0);  

 

and in the client:

case TCP_DATAREADY:  

ClientTCPRead (handle, x, 50, 0);

 

it will only read the x int

help

thanks

Viewing all 5349 articles
Browse latest View live