plcforum.uz.ua

International PLC Forum
It is currently Wed Sep 26, 2018 6:11 pm

All times are UTC + 3 hours


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: ANSI C
PostPosted: Fri Jul 06, 2018 4:09 am 

Joined: Wed Jun 20, 2018 5:22 am
Posts: 13
Поделитесь скриптом как по нажатию кнопки считать значения из IO Field ? 3 день рою найти не могу ничего.


Top
 Profile  
 
 Post subject: Re: ANSI C
PostPosted: Fri Jul 06, 2018 7:49 am 

Joined: Fri Feb 24, 2012 11:28 am
Posts: 109
А какая винсиси?


Top
 Profile  
 
 Post subject: Re: ANSI C
PostPosted: Fri Jul 06, 2018 8:07 am 

Joined: Wed Jun 20, 2018 5:22 am
Posts: 13
7.2


Top
 Profile  
 
 Post subject: Re: ANSI C
PostPosted: Fri Jul 06, 2018 9:00 am 

Joined: Fri Feb 24, 2012 11:28 am
Posts: 109
Это берется с помощью функций GetProp***.
Например:
Code:
char  value[MAX_PATH];
value = GetPropChar(lpszPictureName, "IOField1", "OutputValue"); //lpszPictureName, если картинка та же

Эти функции находятся в редакторе С скрипта в ветке Internal functions/graphics/get/property.


Top
 Profile  
 
 Post subject: Re: ANSI C
PostPosted: Fri Jul 06, 2018 11:51 am 

Joined: Wed Jun 20, 2018 5:22 am
Posts: 13
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
char value [30] = "";
printf("blya\r\n");
value = GetPropChar(lpszPictureName, "IOField1", "OutputValue");
printf("blya1\r\n");
printf("blya2\r\n");
}
ошибка - 0041 left operand must be l-value


Top
 Profile  
 
 Post subject: Re: ANSI C
PostPosted: Fri Jul 06, 2018 12:29 pm 

Joined: Fri Feb 24, 2012 11:28 am
Posts: 109
Ну да, конечно.
Тогда:
Code:
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
char* value;
printf("blya\r\n");
value = GetPropChar(lpszPictureName, "IOField1", "OutputValue");
printf("blya1\r\n");
printf("blya2\r\n");
printf("%s\r\n", value);
}


Top
 Profile  
 
 Post subject: Re: ANSI C
PostPosted: Mon Jul 09, 2018 4:14 am 

Joined: Wed Jun 20, 2018 5:22 am
Posts: 13
Самое оно в мякотку. Спасибо


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by International PLCforum® Forum Software © PLCforum
Mobile version